/*
 * Copyright (c) Hunan Goke,Chengdu Goke,Shandong Goke. 2021. All rights reserved.
 */

#ifndef __ISP_COMM_ISP_H__
#define __ISP_COMM_ISP_H__

#include "type.h"
#include "errcode.h"
#include "common.h"
#include "isp_debug.h"
#include "comm_video.h"
#include "isp_defines.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* End of #ifdef __cplusplus */

/****************************************************************************
 * MACRO DEFINITION                                                         *
 ****************************************************************************/

#define RES_WIDTH_MAX(dev)              (g_au16ResWMax[dev])
#define RES_WIDTH_MIN                   (120)
#define RES_HEIGHT_MAX(dev)             (g_au16ResHMax[dev])
#define RES_HEIGHT_MIN                  (120)
#define FRAME_RATE_MAX                  (65535.0)

#define VREG_MAX_NUM                    (16)

#define AWB_ZONE_ORIG_ROW               (32)
#define AWB_ZONE_ORIG_COLUMN            (32)
#define AE_ZONE_ROW                     (15)
#define AE_ZONE_COLUMN                  (17)
#define MG_ZONE_ROW                     (15)
#define MG_ZONE_COLUMN                  (17)
#define AWB_ZONE_NUM                    (AWB_ZONE_ORIG_ROW * AWB_ZONE_ORIG_COLUMN * AWB_ZONE_BIN)
#define AWB_ZONE_STITCH_MAX             (AWB_ZONE_NUM * ISP_MAX_STITCH_NUM)
#define AF_ZONE_ROW                     (15)
#define AF_ZONE_COLUMN                  (17)
#define LIGHTSOURCE_NUM                 (4)
#define MAX_AWB_LIB_NUM                 (AWB_LIB_NUM)
#define MAX_AE_LIB_NUM                  (AE_LIB_NUM)

#define AE_MIN_WIDTH                    (256)
#define AE_MIN_HEIGHT                   (120)
#define AWB_MIN_WIDTH                   (60)
#define AWB_MIN_HEIGHT                  (14)

#define GAMMA_NODE_NUM                  (1025)
#define PREGAMMA_NODE_NUM               (257)
#define PREGAMMA_SEG_NUM                (8)

#define LCAC_STRENGTH_NUM               (16)

#define ISP_AUTO_ISO_STRENGTH_NUM       (16)
#define ISP_SHARPEN_LUMA_NUM            (32)
#define ISP_SHARPEN_GAIN_NUM            (32)

#define ISP_MAX_SNS_REGS                (32)

#define ISP_RLSC_POINTS                (129)
#define ISP_RLSC_DEFAULT_RADIAL_STR    (4096)
#define ISP_RLSC_DEFAULT_SCALE         (3)
#define ISP_RLSC_DEFAULT_MANUAL_WEIGHT (256)
#define ISP_RLSC_DEFAULT_WBGAIN        (256)
#define ISP_RLSC_DEFAULT_LIGHT         (0)
#define ISP_RLSC_WEIGHT_Q_BITS         (8)

#define ISP_VREG_SIZE_BIN               (0x20000)
#define ALG_LIB_VREG_SIZE_BIN           (0x1000)
#define WDR_MAX_FRAME_NUM               (4)

#define BAYER_CALIBTAION_MAX_NUM        (50)
#define ISP_BAYERNR_STRENGTH_DIVISOR (100)
#define ISP_BAYERNR_CORINGLOW_STRENGTH_DIVISOR (10000)
#define AI_MAX_STEP_FNO_NUM             (1024)

#define ISP_BAS_TAPS_ROW_NUM            (17)
#define ISP_BAS_TAPS_COL_6              (6)
#define ISP_BAS_TAPS_COL_4              (4)
#define ISP_BAYERNR_LUT_LENGTH       (33)
#define ISP_BAYERNR_LMTLUTNUM        (129)
#define PRO_MAX_FRAME_NUM               (8)

#define ISP_DEMOSAIC_LUT_LENGTH      (17)
#define ISP_BAYER_CHN_NUM               (4)
#define BAYER_CHN_R                     0
#define BAYER_CHN_GR                    1
#define BAYER_CHN_GB                    2
#define BAYER_CHN_B                     3
#define LDCI_LPF_LUT_SIZE               (9)
#define LDCI_HE_LUT_SIZE                (33)
#define LDCI_DE_USM_LUT_SIZE            (33)
#define LDCI_COLOR_GAIN_LUT_SIZE        (65)

#define NoiseSet_EleNum                 (7)
#define CCM_MATRIX_SIZE                 (9)
#define CCM_MATRIX_NUM                  (7)

#define ISP_DRC_CUBIC_POINT_NUM      (5)
#define ISP_DRC_CC_NODE_NUM          (33)
#define ISP_DRC_TM_NODE_NUM          (200)
#define ISP_DRC_TM_SEG_NUM           (8)
#define ISP_DRC_EXP_COMP_SAMPLE_NUM  (8)
#define ISP_DRC_SHP_LOG_CONFIG_NUM   (16)

#define LOG_LUT_SIZE                    (1025)
#define PRE_LOG_LUT_SIZE                (1025)

#define ISP_DE_LUMA_GAIN_LUT_N       (17)
#define ISP_EXP_RATIO_STRENGTH_NUM      (16)
#define ISP_LCAC_DET_NUM                (3)

#define ISP_DO_NOT_NEED_SWITCH_IMAGEMODE (-2)

/*****************************************************************************
*******DEFAULT VALUE OF GLOBAL REGISTERS DEFINED HERE*************************
*****************************************************************************/

/* ----------------------- AE ------------------------------- */
#define ISP_TOP_RGGB_START_R_GR_GB_B           (0)
#define ISP_TOP_RGGB_START_GR_R_B_GB           (1)
#define ISP_TOP_RGGB_START_GB_B_R_GR           (2)
#define ISP_TOP_RGGB_START_B_GB_GR_R           (3)

#define ISP_TOP_AE_SELECT_AFTER_DG             (0)
#define ISP_TOP_AE_SELECT_AFTER_WB             (1)
#define ISP_TOP_AE_SELECT_AFTER_DRC            (2)


/* ----------------------- AWB ------------------------------- */
#define ISP_AWB_OFFSET_COMP_DEF                (0)
#define ISP_CCM_COLORTONE_EN_DEFAULT           (1)
#define ISP_CCM_COLORTONE_RGAIN_DEFAULT        (256)
#define ISP_CCM_COLORTONE_BGAIN_DEFAULT        (256)
#define ISP_CCM_COLORTONE_GGAIN_DEFAULT        (256)

#define ISP_CCM_PROT_EN_DEFAULT                (0)
#define ISP_CCM_CC_THD0_DEFAULT                (0)
#define ISP_CCM_CC_THD1_DEFAULT                (0x1E)
#define ISP_CCM_CC_PROT_RATIO_DEFAULT          (10)
#define ISP_CCM_RR_THD0_DEFAULT                (0x1E)
#define ISP_CCM_RR_THD1_DEFAULT                (0x64)
#define ISP_CCM_GG_THD0_DEFAULT                (0x6)
#define ISP_CCM_GG_THD1_DEFAULT                (0x3C)
#define ISP_CCM_BB_THD0_DEFAULT                (0x1E)
#define ISP_CCM_BB_THD1_DEFAULT                (0x64)
#define ISP_CCM_MAX_RGB_DEFAULT                (0xC8)
#define ISP_CCM_RGB_PROT_RATIO_DEFAULT         (10)
#define ISP_CCM_RECOVER_EN_DEFAULT             (1)
#define ISP_CCM_LUM_RATIO_DEFAULT              (256)
#define ISP_CCM_HUE_RATIO_DEFAULT              (256)

#define CCM_CONVERT_PRE(value)  ((value & 0x8000) | (value << 2))
#define CCM_CONVERT(value)      ((value & 0x8000)?((~(value & 0x7FFF)) + 1):(value))
/********************************** DEFINED END **************************************/

/****************************************************************************
 * GENERAL STRUCTURES                                                       *
 ****************************************************************************/
/*
ISP Error Code
0x40 : ISP_NOT_INIT
0x41 : ISP_MEM_NOT_INIT
0x42 : ISP_ATTR_NOT_CFG
0x43 : ISP_SNS_UNREGISTER
0x44 : ISP_INVALID_ADDR
0x45 : ISP_NOMEM
0x46 : ISP_NO_INT
*/
typedef enum ISP_ERR_CODE_E {
    ERR_ISP_NOT_INIT                = 0x40, // ISP not init
    ERR_ISP_MEM_NOT_INIT            = 0x41, // ISP memory not init
    ERR_ISP_ATTR_NOT_CFG            = 0x42, // ISP attribute not cfg
    ERR_ISP_SNS_UNREGISTER          = 0x43, // ISP sensor unregister
    ERR_ISP_INVALID_ADDR            = 0x44, // ISP invalid address
    ERR_ISP_NOMEM                   = 0x45, // ISP nomem
    ERR_ISP_NO_INT                  = 0x46, // ISP
} ISP_ERR_CODE_E;

#define ERR_CODE_ISP_NULL_PTR         DEFINE_ERR_CODE(MOD_ID_ISP, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR)
#define ERR_CODE_ISP_ILLEGAL_PARAM    DEFINE_ERR_CODE(MOD_ID_ISP, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM)
#define ERR_CODE_ISP_NOT_SUPPORT      DEFINE_ERR_CODE(MOD_ID_ISP, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT)

#define ERR_CODE_ISP_NOT_INIT         DEFINE_ERR_CODE(MOD_ID_ISP, EN_ERR_LEVEL_ERROR, ERR_ISP_NOT_INIT)
#define ERR_CODE_ISP_MEM_NOT_INIT     DEFINE_ERR_CODE(MOD_ID_ISP, EN_ERR_LEVEL_ERROR, ERR_ISP_MEM_NOT_INIT)
#define ERR_CODE_ISP_ATTR_NOT_CFG     DEFINE_ERR_CODE(MOD_ID_ISP, EN_ERR_LEVEL_ERROR, ERR_ISP_ATTR_NOT_CFG)
#define ERR_CODE_ISP_SNS_UNREGISTER   DEFINE_ERR_CODE(MOD_ID_ISP, EN_ERR_LEVEL_ERROR, ERR_ISP_SNS_UNREGISTER)
#define ERR_CODE_ISP_INVALID_ADDR     DEFINE_ERR_CODE(MOD_ID_ISP, EN_ERR_LEVEL_ERROR, ERR_ISP_INVALID_ADDR)
#define ERR_CODE_ISP_NOMEM            DEFINE_ERR_CODE(MOD_ID_ISP, EN_ERR_LEVEL_ERROR, ERR_ISP_NOMEM)
#define ERR_CODE_ISP_NO_INT           DEFINE_ERR_CODE(MOD_ID_ISP, EN_ERR_LEVEL_ERROR, ERR_ISP_NO_INT)

/*
Defines the structure of ISP module parameters.
*/
typedef struct ISP_MOD_PARAM_S {
    GK_U32      u32IntBotHalf;  /* RW;Range:[0,1]; Format:32.0; Indicate ISP interrupt bottom half,No distinction vipipe */
    GK_U32      u32QuickStart;  /* RW;Range:[0,1]; Format:32.0; Indicate ISP Quick Start No distinction vipipe. Only used for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_BOOL     bLongFrmIntEn; /*when wdr mode enable/disable long frame pipe interrupt.Only used for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_MOD_PARAM_S;

/*
Defines the structure of ISP control parameters.
*/
typedef struct ISP_CTRL_PARAM_S {
    GK_U32      u32ProcParam;    /* RW;Format:32.0; Indicate the update frequency of ISP_PROC information,No distinction vipipe */
    GK_U32      u32StatIntvl;    /* RW;Range:(0,0xffffffff];Format:32.0; Indicate the time interval of ISP statistic information */
    GK_U32      u32UpdatePos;    /* RW;Range:[0,1]; Format:32.0; Indicate the location of the configuration register of ISP interrupt */
    GK_U32      u32IntTimeOut;   /* RW;Format:32.0; Indicate the time(unit:ms) of interrupt timeout */
    GK_U32      u32PwmNumber;    /* R;Format:32.0; Indicate PWM number */
    GK_U32      u32PortIntDelay; /* RW;Format:32.0; Port intertupt delay value, unit:clk */
    GK_BOOL     bLdciTprFltEn;  /* R;Indicate Enable LDCI temporal filter. Not support changed after isp init */
} ISP_CTRL_PARAM_S;

/*
Defines the working mode of ISP
0 = automatic mode
1 = manual mode
*/
typedef enum ISP_OP_TYPE_E {
    OP_TYPE_AUTO    = 0,
    OP_TYPE_MANUAL  = 1,
    OP_TYPE_BUTT
} ISP_OP_TYPE_E;


/*
Defines the prior frame of ISP
0 = short frame
1 = middle frame
2 = second middle frame
3 = long frame
*/
typedef enum ISP_PRIOR_FRAME_E {
    LONG_FRAME      = 0,
    SHORT_FRAME       = 1,
    PRIOR_FRAME_BUTT
} ISP_PRIOR_FRAME_E;

/*
Defines the ISP correction or detection status
0 = initial status, no calibration
1 = The static defect pixel calibration ends normally
2 = The static defect pixel calibration ends due to timeout.
*/
typedef enum ISP_STATE_E {
    ISP_STATE_INIT     = 0,
    ISP_STATE_SUCCESS  = 1,
    ISP_STATE_TIMEOUT  = 2,
    ISP_STATE_BUTT
} ISP_STATUS_E;

typedef struct ISP_PIPE_DIFF_ATTR_S {
    GK_S32 as32Offset[ISP_BAYER_CHN_NUM];   /* RW;Range:[-4095,4095];Format:12.0; Black level differences between the offset value */
    GK_U32 au32Gain[ISP_BAYER_CHN_NUM];     /* RW;Range:[0x80,0x400];Format:4.8; The gain difference ratio */
    GK_U16 au16ColorMatrix[CCM_MATRIX_SIZE]; /* RW;Range:[0x0,0xFFFF];Format:8.8; Color correction matrix variance ratio */
} ISP_PIPE_DIFF_ATTR_S;

/* Defines the format of the input Bayer image */
typedef enum ISP_BAYER_FORMAT_E {
    BAYER_RGGB    = 0,
    BAYER_GRBG    = 1,
    BAYER_GBRG    = 2,
    BAYER_BGGR    = 3,
    BAYER_BUTT
} ISP_BAYER_FORMAT_E;

/* Defines the bitwidth of the input Bayer image, used for lsc online calibration */
typedef enum ISP_BAYER_RAWBIT_E {
    BAYER_RAWBIT_8BIT    = 8,
    BAYER_RAWBIT_10BIT   = 10,
    BAYER_RAWBIT_12BIT   = 12,
    BAYER_RAWBIT_14BIT   = 14,
    BAYER_RAWBIT_16BIT   = 16,
    BAYER_RAWBIT_BUTT

} ISP_BAYER_RAWBIT_E;



/* ISP public attribute, contains the public image attribute */
typedef struct ISP_PUB_ATTR_S {
    RECT_S          stWndRect;      /* RW; Start position of the cropping window, image width, and image height */
    SIZE_S          stSnsSize;      /* RW; Width and height of the image output from the sensor */
    GK_FLOAT        f32FrameRate;   /* RW; Range: [0, 0xFFFF]; For frame rate */
    ISP_BAYER_FORMAT_E  enBayer;    /* RW; Range:[0,3] ;Format:2.0;the format of the input Bayer image */
    WDR_MODE_E      enWDRMode;      /* RW; WDR mode select */
    GK_U8           u8SnsMode;      /* RW; Range: [0, 0xFF]; Format: 8.0; For special sensor mode switches */
} ISP_PUB_ATTR_S;

/* Slave mode sensor sync signal generate module */
typedef struct ISP_SLAVE_SNS_SYNC_S {
    union {
        struct {
            GK_U32  bit16Rsv          :  16;
            GK_U32  bitHInv           :  1;
            GK_U32  bitVInv           :  1;
            GK_U32  bit12Rsv          :  12;
            GK_U32  bitHEnable        :  1;
            GK_U32  bitVEnable        :  1;
        } stBits;
        GK_U32 u32Bytes;
    } unCfg;

    GK_U32  u32VsTime;
    GK_U32  u32HsTime;
    GK_U32  u32VsCyc;
    GK_U32  u32HsCyc;
    GK_U32  u32SlaveModeTime;

} ISP_SLAVE_SNS_SYNC_S;

/*
Defines the ISP stitch attribute.
*/
/*
Defines the ISP firmware status
0 = Running status
1 = Frozen status
*/
typedef enum ISP_FMW_STATE_E {
    ISP_FMW_STATE_RUN = 0,
    ISP_FMW_STATE_FREEZE,
    ISP_FMW_STATE_BUTT
} ISP_FMW_STATE_E;

/* Defines the WDR mode of the ISP */
typedef struct ISP_WDR_MODE_S {
    WDR_MODE_E  enWDRMode;
} ISP_WDR_MODE_S;

typedef union ISP_MODULE_CTRL_U {
    GK_U64  u64Key;
    struct {
        GK_U64  bitBypassISPDGain      : 1 ;   /* RW;[0] */
        GK_U64  bitBypassAntiFC        : 1 ;   /* RW;[1] */
        GK_U64  bitBypassCrosstalkR    : 1 ;   /* RW;[2] */
        GK_U64  bitBypassDPC           : 1 ;   /* RW;[3] */
        GK_U64  bitBypassNR            : 1 ;   /* RW;[4] */
        GK_U64  bitBypassDehaze        : 1 ;   /* RW;[5] */
        GK_U64  bitBypassWBGain        : 1 ;   /* RW;[6] */
        GK_U64  bitBypassMeshShading   : 1 ;   /* RW;[7] */
        GK_U64  bitBypassDRC           : 1 ;   /* RW;[8] */
        GK_U64  bitBypassDemosaic      : 1 ;   /* RW;[9] */
        GK_U64  bitBypassColorMatrix   : 1 ;   /* RW;[10] */
        GK_U64  bitBypassGamma         : 1 ;   /* RW;[11] */
        GK_U64  bitBypassFSWDR         : 1 ;   /* RW;[12] */
        GK_U64  bitBypassCA            : 1 ;   /* RW;[13];  */
        GK_U64  bitBypassCsConv        : 1 ;   /* RW;[14] */
        GK_U64  bitBypassRadialCrop    : 1 ;   /* RW;[15]; Not support for  V100/ V200/ V300 */
        GK_U64  bitBypassSharpen       : 1 ;   /* RW;[16] */
        GK_U64  bitBypassLCAC          : 1 ;   /* RW;[17] */
        GK_U64  bitBypassGCAC          : 1 ;   /* RW;[18]; /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
        GK_U64  bit2ChnSelect          : 2 ;   /* RW;[19:20] */
        GK_U64  bitBypassLdci          : 1 ;   /* RW;[21] */
        GK_U64  bitBypassPreGamma      : 1 ;   /* RW;[22];  */
        GK_U64  bitBypassRadialShading : 1 ;   /* RW;[23]; Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
        GK_U64  bitBypassAEStatFE      : 1 ;   /* RW;[24] */
        GK_U64  bitBypassAEStatBE      : 1 ;   /* RW;[25] */
        GK_U64  bitBypassMGStat        : 1 ;   /* RW;[26] */
        GK_U64  bitBypassDE            : 1 ;   /* RW;[27] ; Only used for  V100/ V200/ V300 */
        GK_U64  bitBypassAFStatFE      : 1 ;   /* RW;[28] ; Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
        GK_U64  bitBypassAFStatBE      : 1 ;   /* RW;[29] ;  */
        GK_U64  bitBypassAWBStat       : 1 ;   /* RW;[30] ; */
        GK_U64  bitBypassCLUT          : 1 ;   /* RW;[31] ; Not support for  GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
        GK_U64  bitBypassHLC           : 1 ;   /* RW;[32] ; Not support for GK7608V200/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
        GK_U64  bitBypassEdgeMark      : 1 ;   /* RW;[33] ; /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
        GK_U64  bitBypassRGBIR         : 1 ;   /* RW;[34] ; Only used for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
        GK_U64  bitRsv29               : 29 ;  /* H  ; [35:63] */
    };
} ISP_MODULE_CTRL_U;
/*
Defines the ISP FSWDR attributes in combination mode.
 0 = Short exposure data is used when combining
 1 = Long exposure data is used when combining
 */
typedef enum ISP_COMBINE_MODE_E {
    FS_WDR_COMBINE_SHORT_FIRST  = 0,
    FS_WDR_COMBINE_LONG_FIRST   = 1,
    FS_WDR_COMBINE_BUTT
} ISP_COMBINE_MODE_E;

/*
Defines the ISP WDR merge mode.
0 = WDR mode is used
1 = Fusion mode is used
*/
typedef enum ISP_WDR_MERGE_MODE_E {
    MERGE_WDR_MODE      = 0,
    MERGE_FUSION_MODE   = 1,
    MERGE_BUTT
} ISP_WDR_MERGE_MODE_E;

/*
 0 = The function of bnr is off
 1 = The function of bnr is on
*/
typedef enum ISP_BNR_MODE_E {
    BNR_OFF_MODE         = 0,
    BNR_ON_MODE          = 1,
    BNR_BUTT
} ISP_BNR_MODE_E;

typedef enum ISP_WDR_WBGAIN_POSITION_E {
    WDR_WBGAIN_IN_DG1         = 0,
    WDR_WBGAIN_IN_WB          = 1,
    WDR_WBGAIN_POSITION_BUTT
} ISP_WDR_WBGAIN_POSITION_E;

typedef struct ISP_FSWDR_MANUAL_ATTR_S {
    GK_U8 u8MdThrLowGain;
    GK_U8 u8MdThrHigGain;
} ISP_FSWDR_MANUAL_ATTR_S;

typedef struct ISP_FSWDR_AUTO_ATTR_S {
    GK_U8 au8MdThrLowGain[ISP_AUTO_ISO_STRENGTH_NUM];
    GK_U8 au8MdThrHigGain[ISP_AUTO_ISO_STRENGTH_NUM];
} ISP_FSWDR_AUTO_ATTR_S;

typedef struct ISP_MDT_ATTR_S {
    GK_BOOL bShortExpoChk;     /* RW;Range:[0x0,0x1];Format:1.0; */
    GK_U16  u16ShortCheckThd;   /* RW;Range:[0x0,0xFFF];Format:12.0 */
    GK_BOOL bMDRefFlicker;
    GK_U8   u8MdtStillThd;     /* RW;Range:[0x0,0xFE];Format:8.0 */
    GK_U8   u8MdtFullThd;      /* RW;Range:[0x0,0xFE];Format:8.0,Only used for GK7608V200 */
    GK_U8   u8MdtLongBlend;    /* RW;Range:[0x0,0xFE] */
    ISP_OP_TYPE_E enOpType;
    ISP_FSWDR_MANUAL_ATTR_S stManual;
    ISP_FSWDR_AUTO_ATTR_S   stAuto;
} ISP_FSWDR_MDT_ATTR_S;


typedef struct ISP_WDR_COMBINE_ATTR_S {
    GK_BOOL bMotionComp;              /* RW;Range:[0x0,0x1];Format:1.0; GK_TRUE: enable motion compensation; GK_FALSE: disable motion compensation */
    GK_U16  u16ShortThr;              /* RW;Range:[0x0,0xFFF];Format:12.0; Data above this threshold will be taken from short exposure only. */
    GK_U16  u16LongThr;               /* RW;Range:[0x0,0xFFF];Format:12.0; limited range :[0x0,u16ShortThr],Data below this threshold will be taken from long exposure only. */
    GK_BOOL bForceLong;               /* RW;Range:[0x0,0x1];Format:1.0; GK_TRUE: enable Force Long; GK_FALSE: disable Force Long,Not support for GK7608V200 */
    GK_U16  u16ForceLongLowThr;       /* RW;Range:[0x0,0xFFF];Format:12.0; Data above this threshold will Force to choose long frame only,Not support for GK7608V200 */
    GK_U16  u16ForceLongHigThr;       /* RW;Range:[0x0,0xFFF];Format:12.0; Data below this threshold will Force to choose long frame only,Not support for GK7608V200 */
    ISP_FSWDR_MDT_ATTR_S stWDRMdt;
} ISP_WDR_COMBINE_ATTR_S;

typedef struct ISP_FUSION_ATTR_S {
    GK_U16  au16FusionThr[4];      /* RW;Range:[0x0,0x3FFF];Format:14.0;The threshold of the 4 frame */
} ISP_FUSION_ATTR_S;

typedef struct ISP_WDR_BNR_ATTR_S {
    ISP_BNR_MODE_E enBnrMode;         /* RW;Range:[0x0,0x1];Format:1.0; GK_TRUE:enable the bnr of wdr;GK_FALSE:disable the bnr of wdr */
    GK_BOOL        bShortFrameNR;     /* RW;Range:[0x0,0x1];Format:1.0; GK_TRUE:enable the bnr of short frame;GK_FALSE:disable the bnr of short frame,Only used for GK7606V100 */
    GK_U8          u8ShortFrameNRStr; /* RW;Range:[0x0,0x3F];Format:8.0;the Level 2 short frame sigma weight of G channel,Only used for GK7606V100                             */
    GK_U8          u8FusionBnrStr;    /* RW;Range:[0x0,0x3F];Format:3.3,Only used for GK7606V100   */
    GK_U8          au8NoiseFloor[NoiseSet_EleNum];  /* RW;Range:[0x0,0xFF];Format:8.0,Only used for GK7608V200/GK7606V100   */
    GK_U8          u8FullMdtSigGWgt;  /* RW;Range:[0x0,0x1F];Format:8.0,Only used for GK7606V100   */
    GK_U8          u8FullMdtSigRBWgt; /* RW;Range:[0x0,0x1F];Format:8.0,Only used for GK7606V100  */
    GK_U8          u8FullMdtSigWgt;  /* RW;Range:[0x0,0x1F];Format:8.0,Only used for GK7608V200 */
    GK_U8          au8GsigmaGain[3];  /* RW;Range:[0x0,0xFF];Format:8.0,Only used for GK7608V200/GK7606V100  */
    GK_U8          au8RBsigmaGain[3]; /* RW;Range:[0x0,0xFF];Format:8.0,Only used for GK7608V200/GK7606V100  */
} ISP_WDR_BNR_ATTR_S;

typedef struct ISP_WDR_FS_ATTR_S {
    ISP_WDR_MERGE_MODE_E enWDRMergeMode;
    ISP_WDR_COMBINE_ATTR_S stWDRCombine;
    ISP_WDR_BNR_ATTR_S stBnr;         /* Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    ISP_FUSION_ATTR_S stFusion;
    ISP_WDR_WBGAIN_POSITION_E enWDRWbgainPosition; /* RW; Range: [0x0, 0x1]; WDR Gain with or without WB Gain. Only used for GK7608V200 */
} ISP_WDR_FS_ATTR_S;

typedef struct ISP_DRC_CUBIC_POINT_ATTR_S {
    GK_U16 u16X;        /* RW; Range:[0,1000];  Format:10.0; x position of the characteristic point of the cubic curve; Only used for GK7608V200 */
    GK_U16 u16Y;        /* RW; Range:[0,1000];  Format:10.0; y position of the characteristic point of the cubic curve; Only used for GK7608V200 */
    GK_U16 u16Slope;    /* RW; Range:[0,10000]; Format:14.0; slope of the characteristic point of the cubic curve; Only used for GK7608V200 */
} ISP_DRC_CUBIC_POINT_ATTR_S;

typedef struct ISP_DRC_ASYMMETRY_CURVE_ATTR_S {
    GK_U8   u8Asymmetry;              /* RW; Range:[0x1, 0x1E]; Format:5.0; The parameter0 of DRC asymmetry tone mapping curve */
    GK_U8   u8SecondPole;             /* RW; Range:[0x96,0xD2]; Format:8.0; The parameter1 of DRC asymmetry tone mapping curve */
    GK_U8   u8Stretch;                /* RW; Range:[0x1E,0x3C]; Format:6.0; The parameter2 of DRC asymmetry tone mapping curve */
    GK_U8   u8Compress;               /* RW; Range:[0x64,0xC8]; Format:8.0; The parameter3 of DRC asymmetry tone mapping curve */
} ISP_DRC_ASYMMETRY_CURVE_ATTR_S;

typedef struct ISP_DRC_MANUAL_ATTR_S {
    GK_U16  u16Strength;          /* RW; Range:GK7608V200 = [0x0, 0xFF] | GK7606V100 = [0x0, 0x3FF] |  V100 = [0x0, 0x3FF] |  V200 = [0x0, 0x3FF] |  V300 = [0x0, 0x3FF] |
                                     GK7205V200 = [0x0, 0x3FF] | GK7205V300 = [0x0, 0x3FF] | GK7202V300 = [0x0, 0x3FF] | GK7605V100 = [0x0, 0x3FF];
                                     Strength of dynamic range compression. Higher values lead to higher differential gain between shadows and highlights. */
} ISP_DRC_MANUAL_ATTR_S;

typedef struct ISP_DRC_AUTO_ATTR_S {
    GK_U16  u16Strength;   /* RW; Range:GK7608V200 = [0x0, 0xFF] | GK7606V100 = [0x0, 0x3FF] |  V100 = [0x0, 0x3FF]|  V200 = [0x0, 0x3FF] | V300 = [0x0, 0x3FF] |
                                                 GK7205V200 = [0x0, 0x3FF] | GK7205V300 = [0x0, 0x3FF]|GK7202V300 = [0x0, 0x3FF]|GK7605V100 = [0x0, 0x3FF];
                                                 It is the base strength. The strength used in ISP is generated by firmware.
                                                 n linear mode, strength = f1(u16Strength, histogram)
                                                 In sensor WDR mode: strength = f2(u16Strength, histogram)
                                                 In 2to1 WDR mode: strength = f3(ExpRatio) */

    GK_U16 u16StrengthMax; /* RW; Range: GK7608V200 = [0x0, 0xFF] | GK7606V100 = [0x0, 0x3FF] |  V100 = [0x0, 0x3FF] |  V200 = [0x0, 0x3FF] |
                                                  V300 = [0x0, 0x3FF] | GK7205V200 = [0x0, 0x3FF]|
                                                 GK7205V300 = [0x0, 0x3FF] | GK7202V300 = [0x0, 0x3FF]| GK7605V100 = [0x0, 0x3FF]; Maximum DRC strength in Auto mode */
    GK_U16 u16StrengthMin; /* RW; Range: GK7608V200 = [0x0, 0xFF] | GK7606V100 = [0x0, 0x3FF] |  V100 = [0x0, 0x3FF] |  V200 = [0x0, 0x3FF] |
                                                  V300 = [0x0, 0x3FF] | GK7205V200 = [0x0, 0x3FF] |
                                                 GK7205V300 = [0x0, 0x3FF]|GK7202V300 = [0x0, 0x3FF]|GK7605V100 = [0x0, 0x3FF]; Minimum DRC strength in Auto mode */

} ISP_DRC_AUTO_ATTR_S;


/* DRC curve type: 0 = Asymmetry curve, 1 = Cubic curve, 2 = User-defined curve */
typedef enum ISP_DRC_CURVE_SELECT_E {
    DRC_CURVE_ASYMMETRY = 0x0,
    DRC_CURVE_CUBIC,      /* Only used for GK7608V200 */
    DRC_CURVE_USER,
    DRC_CURVE_BUTT
} ISP_DRC_CURVE_SELECT_E;

typedef struct ISP_DRC_ATTR_S {
    GK_BOOL bEnable;
    ISP_DRC_CURVE_SELECT_E enCurveSelect;  /* RW; Range:[0x0, 0x2]; Select tone mapping curve type */

    GK_U8  u8PDStrength;           /* RW; Range:[0x0, 0x80]; Format:8.0; Controls the purple detection strength,
                                      Only used for GK7608V200/GK7606V100/ V100/ V200/ V300 */
    GK_U8  u8LocalMixingBrightMax; /* RW; Range:[0x0, 0x80]; Format:8.0; Maximum enhancement strength for positive detail */
    GK_U8  u8LocalMixingBrightMin; /* RW; Range:[0x0, 0x40]; Format:8.0; Minimum enhancement strength for positive detail */
    GK_U8  u8LocalMixingBrightThr; /* RW; Range:[0x0, 0xFF]; Format:8.0; Luma threshold for enhancement strength adaptation of positive detail */
    GK_S8  s8LocalMixingBrightSlo; /* RW; Range:[-7, 7]; Format:s4.0; Enhancement strength adaptation slope for positive detail */
    GK_U8  u8LocalMixingDarkMax;   /* RW; Range:[0x0, 0x80]; Format:8.0; Maximum enhancement strength for negative detail */
    GK_U8  u8LocalMixingDarkMin;   /* RW; Range:[0x0, 0x40]; Format:8.0; Minimum enhancement strength for negative detail */
    GK_U8  u8LocalMixingDarkThr;   /* RW; Range:[0x0, 0xFF]; Format:8.0; Luma threshold for enhancement strength adaptation of negative detail */
    GK_S8  s8LocalMixingDarkSlo;   /* RW; Range:[-7, 7]; Format:s4.0; Enhancement strength adaptation slope for negative detail */

    GK_U8  u8DetailBrightStr;      /* RW; Range:[0x0, 0x80]; Format:8.0; Controls the gain of the non-linear positive detail enhancement; Only used for GK7608V200 */
    GK_U8  u8DetailDarkStr;        /* RW; Range:[0x0, 0x80]; Format:8.0; Controls the gain of the non-linear negative detail enhancement; Only used for GK7608V200 */
    GK_U8  u8DetailBrightStep;     /* RW; Range:[0x0, 0x80]; Format:8.0; Controls the step of the non-linear positive detail enhancement; Only used for GK7608V200 */
    GK_U8  u8DetailDarkStep;       /* RW; Range:[0x0, 0x80]; Format:8.0; Controls the step of the non-linear negative detail enhancement; Only used for GK7608V200 */

    GK_U8  u8BrightGainLmt;        /* RW; Range:[0x0, 0xF];  Format:4.0; Bright area gain high limit */
    GK_U8  u8BrightGainLmtStep;    /* RW; Range:[0x0, 0xF];  Format:4.0; Bright area gain high limit step */
    GK_U8  u8DarkGainLmtY;         /* RW; Range:[0x0, 0x85]; Format:7.0; Dark area luma gain limit */
    GK_U8  u8DarkGainLmtC;         /* RW; Range:[0x0, 0x85]; Format:7.0; Dark area chroma gain limit */
    GK_U16 au16ColorCorrectionLut[ISP_DRC_CC_NODE_NUM]; /* RW; Range:[0x0, 0x400]; Format:4.12; LUT of color correction coefficients */
    GK_U16 au16ToneMappingValue[ISP_DRC_TM_NODE_NUM];   /* RW; Range:[0x0, 0xffff]; Format:16.0; LUT of user-defined curve */

    GK_U8  u8FltScaleCoarse;     /* RW; Range:[0x0, 0xF]; Format:4.0; Spatial filter scale coarse control; Only used for GK7608V200 and GK7606V100 */
    GK_U8  u8FltScaleFine;       /* RW; Range:[0x0, 0xF]; Format:4.0; Spatial filter scale fine control; Only used for GK7608V200 and GK7606V100  */
    GK_U8  u8ContrastControl;    /* RW; Range:[0x0, 0xF]; Format:4.0; Contrast control */
    GK_S8  s8DetailAdjustFactor; /* RW; Range:[-15, 15];  Format:4.0; Detail adjustment factor */

    GK_U8  u8SpatialFltCoef;     /* RW; Range: GK7608V200 = [0x0, 0xA] | GK7606V100 = [0x0, 0x5] |  V100 = [0x0, 0x5] |  V200 = [0x0, 0x5] |
                                                                       V300 = [0x0, 0x5] |
                                                                      GK7205V200 = [0x0, 0x5] | GK7205V300 = [0x0, 0x5] |GK7202V300 = [0x0, 0x5]|GK7605V100 = [0x0, 0x5];
                                                                      Spatial filter coefficients */
    GK_U8  u8RangeFltCoef;       /* RW; Range:[0x0, 0xA]; Format:4.0; Range filter coefficients */
    GK_U8  u8RangeAdaMax;        /* RW; Range:[0x0, 0x8]; Format:4.0; Maximum range filter coefficient adaptation range */

    GK_U8  u8GradRevMax;         /* RW; Range:[0x0, 0x40]; Format:7.0; Maximum gradient reversal reduction strength */
    GK_U8  u8GradRevThr;         /* RW; Range:[0x0, 0x80]; Format:8.0; Gradient reversal reduction threshold */

    GK_U8  u8DpDetectRangeRatio; /* RW; Range:[0x0, 0x1F]; Format:5.0; DRC defect pixel detection control parameter; Only used for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8  u8DpDetectThrSlo;     /* RW; Range:[0x0, 0x1F]; Format:5.0; DRC defect pixel detection control parameter; Only used for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16 u16DpDetectThrMin;    /* RW; Range:[0x0, 0xFFFF]; Format:16.0; DRC defect pixel detection control parameter; Only used for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */

    ISP_OP_TYPE_E enOpType;
    ISP_DRC_MANUAL_ATTR_S stManual;
    ISP_DRC_AUTO_ATTR_S   stAuto;
    ISP_DRC_CUBIC_POINT_ATTR_S astCubicPoint[ISP_DRC_CUBIC_POINT_NUM]; /* Only used for GK7608V200 */
    ISP_DRC_ASYMMETRY_CURVE_ATTR_S stAsymmetryCurve;

} ISP_DRC_ATTR_S;

typedef struct ISP_LDCI_GAUSS_COEF_ATTR_S {
    GK_U8   u8Wgt;      /* RW;Range:GK7608V200 = [0x0, 0x80] | GK7606V100 = [0x0, 0x80]|  V100 = [0x0, 0xFF] |  V200 = [0x0, 0xFF]|
                                                            V300 = [0x0, 0xFF] |
                                                           GK7205V200 = [0x0, 0xFF] | GK7205V300 = [0x0, 0xFF] | GK7202V300 = [0x0, 0xFF]| GK7605V100 = [0x0, 0xFF];
                                                           Format:1.7;Weight of Gaussian distribution */
    GK_U8   u8Sigma;    /* RW;Range: [0x1, 0xFF];Format:0.8;Sigma of Gaussian distribution */
    GK_U8   u8Mean;     /* RW;Range: [0x0, 0xFF];Format:0.8;Mean of Gaussian distribution */
} ISP_LDCI_GAUSS_COEF_ATTR_S;

typedef struct ISP_LDCI_HE_WGT_ATTR_S {
    ISP_LDCI_GAUSS_COEF_ATTR_S  stHePosWgt;
    ISP_LDCI_GAUSS_COEF_ATTR_S  stHeNegWgt;
} ISP_LDCI_HE_WGT_ATTR_S;

typedef struct ISP_LDCI_MANUAL_ATTR_S {
    ISP_LDCI_HE_WGT_ATTR_S  stHeWgt;
    GK_U16                  u16BlcCtrl; /* RW;Range: [0x0, 0x1FF];Format:9.0;Restrain dark region */
} ISP_LDCI_MANUAL_ATTR_S;

typedef struct ISP_LDCI_AUTO_ATTR_S {
    ISP_LDCI_HE_WGT_ATTR_S  astHeWgt[ISP_AUTO_ISO_STRENGTH_NUM];
    GK_U16                  au16BlcCtrl[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW;Range: [0x0, 0x1FF];Format:9.0;auto mode, Restrain dark region */
} ISP_LDCI_AUTO_ATTR_S;

typedef struct ISP_LDCI_ATTR_S {
    GK_BOOL                 bEnable;                /* RW;Range:[0x0,0x1];Format:1.0; */
    GK_U8                   u8GaussLPFSigma;        /* RW;Range: [0x1, 0xFF];Format:0.8;Coefficient of Gaussian low-pass filter */
    ISP_OP_TYPE_E           enOpType;
    ISP_LDCI_MANUAL_ATTR_S  stManual;
    ISP_LDCI_AUTO_ATTR_S    stAuto;
    GK_U16                  u16TprIncrCoef;         /* RW;Range: [0x0, 0x100];Format:0.9;Increase Coefficient of temporal filter */
    GK_U16                  u16TprDecrCoef;         /* RW;Range: [0x0, 0x100];Format:0.9;Decrease Coefficient of temporal filter */
} ISP_LDCI_ATTR_S;

/*
defines CA type
0 = enable Ca module
1 = enable Cp module
 */
typedef enum ISP_CA_TYPE_E {
    ISP_CA_ENABLE = 0x0,
    ISP_CP_ENABLE,
    ISP_CA_BUTT
} ISP_CA_TYPE_E;

typedef struct ISP_CA_LUT_S {
    GK_U32  au32YRatioLut[ISP_CA_YRATIO_LUT_LENGTH];  /* RW;Range:[0,2047];Format:1.11; */
    GK_S32  as32ISORatio[ISP_AUTO_ISO_STRENGTH_NUM];     /* RW;Range:[0,2047];Format:1.10; */
} ISP_CA_LUT_S;

typedef struct ISP_CP_LUT_S {
    GK_U8   au8CPLutY[ISP_CA_YRATIO_LUT_LENGTH]; /* RW;Range:[0,255];Format:8.0;Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8   au8CPLutU[ISP_CA_YRATIO_LUT_LENGTH]; /* RW;Range:[0,255];Format:8.0;Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8   au8CPLutV[ISP_CA_YRATIO_LUT_LENGTH]; /* RW;Range:[0,255];Format:8.0;Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_CP_LUT_S;

/*  */
typedef struct ISP_CA_ATTR_S {
    GK_BOOL bEnable;            /* RW;Range:[0x0,0x1];Format:1.0; */
    ISP_CA_TYPE_E eCaCpEn;      /* Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    ISP_CA_LUT_S stCA;          /*  */
    ISP_CP_LUT_S stCP;          /* Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_CA_ATTR_S;

// CSC

typedef struct CSC_MATRX_S {
    GK_S16 as16CSCIdc[3];  /* RW; Range:[-1024, 1023]; Format: 11.0; Input dc component for csc matrix */
    GK_S16 as16CSCOdc[3];  /* RW; Range:[-1024, 1023]; Format: 11.0; Output dc component for csc matrix */
    GK_S16 as16CSCCoef[9]; /* RW; Range:[-4096, 4095]; Format: 5.10; 3x3 coefficients for csc matrix */
} CSC_MATRX_S;

typedef struct ISP_CSC_ATTR_S {
    GK_BOOL bEnable;            /* RW; Range:[0, 1];Format:1.0; Enable/Disable CSC Function */

    COLOR_GAMUT_E enColorGamut; /* RW; Range: [0, 4]; Color gamut type; COLOR_GAMUT_BT2020 only used for GK7608V200 */
    GK_U8   u8Hue;              /* RW; Range:[0, 100];Format:8.0; Csc Hue Value */
    GK_U8   u8Luma;             /* RW; Range:[0, 100];Format:8.0; Csc Luma Value */
    GK_U8   u8Contr;            /* RW; Range:[0, 100];Format:8.0; Csc Contrast Value */
    GK_U8   u8Satu;             /* RW; Range:[0, 100];Format:8.0; Csc Saturation Value */
    GK_BOOL bLimitedRangeEn;    /* RW; Range: [0x0, 0x1]; Enable/Disable: Enable Limited range output mode(default full range output) */
    GK_BOOL bExtCscEn;          /* RW; Range: [0x0, 0x1]; Enable/Disable: Enable extended luma range */
    GK_BOOL bCtModeEn;          /* RW; Range: [0x0, 0x1]; Enable/Disable: Enable ct mode */
    CSC_MATRX_S stCscMagtrx;    /* RW; Color Space Conversion matrix */

} ISP_CSC_ATTR_S;

/********************** CLUT **************************************/

typedef struct ISP_CLUT_ATTR_S {
    GK_BOOL         bEnable         ; /* RW; Range:[0, 1];Format:1.0; Enable/Disable CLUT Function,Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U32          u32GainR        ; /* RW; Range:[0,4095];Format:12.0,Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U32          u32GainG        ; /* RW; Range:[0,4095];Format:12.0,Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U32          u32GainB        ; /* RW; Range:[0,4095];Format:12.0,Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_CLUT_ATTR_S;

/* CLUT LUT */

typedef struct ISP_CLUT_LUT_S {
    GK_U32 au32lut[ISP_CLUT_LUT_LENGTH];     /* RW; Range: GK7608V200 = [0, 4294967295] | GK7606V100 = [0x0, 1073741823]|  V100 = [0x0, 1073741823]|
                                                    V200 = [0x0, 1073741823] |  V300 = [0x0, 1073741823];
                                                   Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_CLUT_LUT_S;

/*****************************************************************/


/*
Defines the type of static defect pixel calibration
0 = bright defect pixel calibration
1 = dark defect pixel calibration
 */
typedef enum ISP_STATIC_DP_TYPE_E {
    ISP_STATIC_DP_BRIGHT = 0x0,
    ISP_STATIC_DP_DARK,
    ISP_STATIC_DP_BUTT
} ISP_STATIC_DP_TYPE_E;


typedef struct ISP_DP_STATIC_CALIBRATE_S {
    GK_BOOL bEnableDetect;                  /* RW; Range: [0, 1];Format 1.0;Set 'GK_TRUE'to start static defect-pixel calibration, and firmware will set 'GK_FALSE' when finished,Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    ISP_STATIC_DP_TYPE_E enStaticDPType;    /* RW; Range: [0, 1];Format 1.0;Select static bright/dark defect-pixel calibration,Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8   u8StartThresh;                  /* RW; Range: [1, 255]; Format 8.0;Start threshold for static defect-pixel calibraiton,Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16  u16CountMax;                    /* RW; Range:GK7608V200 = [0, 8192] | GK7606V100 = [0, 8192]|  V100 = [0, 6144] |  V200 = [0, 6144] |
                                                V300 = [0, 6144];Format 14.0;
                                               limited Range: [0, STATIC_DP_COUNT_NORMAL*BlkNum],Limit of max number of static defect-pixel calibraiton.
                                               Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16  u16CountMin;                    /* RW; Range:GK7608V200 = [0, 8192] | GK7606V100 = [0, 8192]|  V100 = [0, 6144] |  V200 = [0, 6144]|
                                                V300 = [0, 6144];Format 14.0;
                                               limited Range: [0, u16CountMax],Limit of min number of static defect-pixel calibraiton.
                                               Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16  u16TimeLimit;                   /* RW; Range: [0x0, 1600];Format 11.0;Time limit for static defect-pixel calibraiton, in frame number,Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */

    GK_U32      au32Table[STATIC_DP_COUNT_MAX];  /* R;  [0,0x1FFF1FFF];Format 29.0;Static defect-pixel calibraiton table,0~12 bits represents the X coordinate of the defect pixel, 16~28 bits represent the Y coordinate of the defect pixel.
                                                  Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8       u8FinishThresh;   /* R; Range: [0, 255];Format 8.0; Finish threshold for static defect-pixel calibraiton,Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16      u16Count;         /* R; Range:GK7608V200 = [0, 8192] | GK7606V100 = [0, 8192]  V100 = [0, 6144]|  V200 = [0, 6144]|
                                      V300 = [0, 6144];Format 14.0; Finish number for static defect-pixel calibraiton
                                     Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    ISP_STATUS_E enStatus;        /* R; Range: [0, 2];Format 2.0;Status of static defect-pixel calibraiton,Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_DP_STATIC_CALIBRATE_S;

typedef struct ISP_DP_STATIC_ATTR_S {
    GK_BOOL bEnable;                /* RW; Range: [0, 1];Format 1.0;Enable/disable the static defect-pixel module,Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16  u16BrightCount;         /* RW; Range:GK7608V200 = [0, 8192] | GK7606V100 = [0, 8192]|  V100 = [0, 6144]|  V200 = [0, 6144]|
                                        V300 = [0, 6144];Format 14.0;limited Range: [0, STATIC_DP_COUNT_NORMAL*BlkNum],
                                       When used as input(W), indicate the number of static bright defect pixels;As output(R),indicate the number of static bright and dark defect pixels.
                                       Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16  u16DarkCount;           /* RW; Range:GK7608V200 = [0, 8192] | GK7606V100 = [0, 8192]|  V100 = [0, 6144]|  V200 = [0, 6144]|
                                        V300 = [0, 6144];Format 14.0;limited Range: [0, STATIC_DP_COUNT_NORMAL*BlkNum],
                                       When used as input(W), indicate the number of static dark defect pixels; As output(R), invalid value 0.
                                       Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U32  au32BrightTable[STATIC_DP_COUNT_MAX];   /* RW; Range: [0x0, 0x1FFF1FFF];Format 29.0;0~12 bits represents the X coordinate of the defect pixel, 16~28 bits represent the Y coordinate of the defect pixel
                                                       Notice : When used as input(W), indicate static bright defect pixels table;  As output(R), indicate static bright and dark defect pixels table.
                                                       Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */

    GK_U32  au32DarkTable[STATIC_DP_COUNT_MAX];     /* RW; Range: [0x0, 0x1FFF1FFF];Format 29.0;0~12 bits represents the X coordinate of the defect pixel, 16~28 bits represent the Y coordinate of the defect pixel
                                                       Notice : When used as input(W), indicate static dark defect pixels table;  As output(R), invalid value.
                                                       Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_BOOL bShow;                  /* RW; Range: [0, 1];Format 1.0;RW;highlight static defect pixel,Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_DP_STATIC_ATTR_S;

typedef struct ISP_DP_DYNAMIC_MANUAL_ATTR_S {
    GK_U16  u16Strength;          /* RW; Range: [0, 255];Format:8.0;Dynamic DPC strength. */
    GK_U16  u16BlendRatio;        /* RW; Range: [0, 128];Format:9.0;Blending ratio required for DPC */
} ISP_DP_DYNAMIC_MANUAL_ATTR_S;

typedef struct ISP_DP_DYNAMIC_AUTO_ATTR_S {
    GK_U16  au16Strength[ISP_AUTO_ISO_STRENGTH_NUM];  /* RW; Range: [0, 255];Format:8.0;Dynamic DPC strength. */
    GK_U16  au16BlendRatio[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range: [0, 128];Format:9.0;Blending ratio required for DPC */
} ISP_DP_DYNAMIC_AUTO_ATTR_S;

typedef struct ISP_DP_DYNAMIC_ATTR_S {
    GK_BOOL bEnable;            /* RW; Range: [0, 1];Format 1.0;Enable/disable the dynamic defect-pixel module */
    GK_BOOL bSupTwinkleEn;      /* RW; Range: [0, 1];Format 1.0;Enable/disable the twinkle suppression  module */
    GK_S8   s8SoftThr;          /* RW; Range: [0, 127];Format s8.0;twinkle suppression threshold */
    GK_U8   u8SoftSlope;        /* RW; Range: [0, 255];Format 8.0;Correction controlling parameter of the pixels whose deviation is smaller than s8SoftThr. */
    ISP_OP_TYPE_E enOpType;     /* RW; Range: [0, 1];Format 1.0;Working mode of dynamic DPC */
    ISP_DP_DYNAMIC_MANUAL_ATTR_S stManual;
    ISP_DP_DYNAMIC_AUTO_ATTR_S   stAuto;
} ISP_DP_DYNAMIC_ATTR_S;

typedef struct ISP_DIS_ATTR_S {
    GK_BOOL bEnable; /* RW; Range: [0, 1];Format 1.0;Enable/disable dis module,Not support for  V100/ V200/ V300 */
} ISP_DIS_ATTR_S;


typedef struct ISP_SHADING_ATTR_S {
    GK_BOOL bEnable;            /* RW; Range:[0, 1];Format:1.0; GK_TRUE: enable lsc; GK_FALSE: disable lsc */
    GK_U16  u16MeshStr;         /* RW; Range:GK7608V200=[0, 65535]| GK7606V100=[0, 65535]| V100=[0, 65535]| V200=[0, 65535]| V300=[0, 65535]|
                                   GK7205V200 = [0x0, 1023] | GK7205V300 = [0x0,1023] | GK7202V300 = [0x0,1023] | GK7605V100 = [0x0,1023];
                                  The strength of the mesh shading correction */
    GK_U16  u16BlendRatio;      /* RW; Range:[0, 256];Format:9.0; the blendratio of the two mesh gain lookup-table */
} ISP_SHADING_ATTR_S;

typedef struct ISP_SHADING_LUT_S {
    GK_U16  au16RGain[ISP_LSC_GRID_POINTS];  /* RW; Range:[0,1023];Member used to store the calibration data of the R channel required for LSC. */
    GK_U16  au16GrGain[ISP_LSC_GRID_POINTS]; /* RW; Range:[0,1023];Member used to store the calibration data of the Gr channel required for LSC. */
    GK_U16  au16GbGain[ISP_LSC_GRID_POINTS]; /* RW; Range:[0,1023];Member used to store the calibration data of the Gb channel required for LSC. */
    GK_U16  au16BGain[ISP_LSC_GRID_POINTS];  /* RW; Range:[0,1023];Member used to store the calibration data of the B channel required for LSC. */
} ISP_SHADING_GAIN_LUT_S;

typedef struct ISP_BNR_LSC_GAIN_LUT_S {
    GK_U16  au16RGain[ISP_RLSC_POINTS];  /* RW; Range:[0,65535];Member used to store the calibration data of the R channel required for BNR_LSC.Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16  au16GrGain[ISP_RLSC_POINTS]; /* RW; Range:[0,65535];Member used to store the calibration data of the Gr channel required for BNR_LSC.Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16  au16GbGain[ISP_RLSC_POINTS]; /* RW; Range:[0,65535];Member used to store the calibration data of the Gb channel required for BNR_LSC.Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16  au16BGain[ISP_RLSC_POINTS];  /* RW; Range:[0,65535];Member used to store the calibration data of the B channel required for BNR_LSC.Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_BNR_LSC_GAIN_LUT_S;

typedef struct ISP_SHADING_LUT_ATTR_S {
    GK_U8   u8MeshScale;        /* RW; Range:[0, 7];Format:3.0;Three bit value that selects the scale and precision for the 10 bit gain coefficients stored in mesh tables */
    GK_U16  au16XGridWidth[(ISP_LSC_GRID_COL - 1) / 2]; /* RW; Range:GK7608V200=[4, 1988]| GK7606V100=[4, 1988]| V100=[4, 1092]| V200=[4, 1092]|
                                                              V300=[4, 1092] | GK7205V200 = [4,255]|GK7205V300 = [4,255]|GK7202V300 = [4,255]|GK7605V100 = [4,255];
                                                             limited Range:[4, u32Width/4 - 60], Member used to store the width data of each GRID partition */
    GK_U16  au16YGridWidth[(ISP_LSC_GRID_ROW - 1) / 2]; /* RW; Range:GK7608V200=[4, 1988]| GK7606V100=[4, 1988]| V100=[4, 1092]| V200=[4, 1092]|
                                                              V300=[4, 1092]|GK7205V200 = [4,255]|GK7205V300 =[4,255]| GK7202V300 = [0,255 ]| GK7605V100 = [0,255 ];
                                                             limited Range:[4, u32Height/4 - 60]; Member used to store the height data of each GRID partition */
    ISP_SHADING_GAIN_LUT_S astLscGainLut[2];
    ISP_BNR_LSC_GAIN_LUT_S stBNRLscGainLut; /* Not support for GK7608V200/GK7606V100 */
} ISP_SHADING_LUT_ATTR_S;

typedef struct ISP_MLSC_CALIBRATION_CFG_S {
    ISP_BAYER_FORMAT_E enBayer;   /* RW; Range: [0, 3];Format ENUM;Shows bayer pattern */
    ISP_BAYER_RAWBIT_E enRawBit;  /* RW; Range: {8,10,12,14,16};Format ENUM;Shows input raw bitwidth */

    GK_U16  u16ImgHeight; /* RW; Range: [0, 65535];Format 16.0;Input raw image height */
    GK_U16  u16ImgWidth;  /* RW; Range: [0, 65535];Format 16.0;Input raw image width */

    GK_U16  u16DstImgHeight; /* RW; Range: [0, 65535];Format 16.0;limited Range:[0, u16ImgHeight],Image height that crop from input raw image, set to ImgHeight if don't need to crop */
    GK_U16  u16DstImgWidth;  /* RW; Range: [0, 65535];Format 16.0;limited Range:[0, u16ImgWidth],Image width that crop from input raw image, set to ImgWidth if don't need to crop */
    GK_U16  u16OffsetX;      /* RW; Range: [0, 65535];Format 16.0;limited Range:[0, u16ImgWidth - u16DstImgWidth],Horizontal offset that crop from input raw image, set to 0 if don't need to crop */
    GK_U16  u16OffsetY;      /* RW; Range: [0, 65535];Format 16.0;limited Range:[0, u16ImgHeight - u16DstImgHeight],Vertical offset that crop from input raw image, set to 0 if don't need to crop */

    GK_U32  u32MeshScale; /* RW; Range: [0, 7];Format 3.0; Shows Mesh Scale value */

    GK_U16  u16BLCOffsetR; /* RW; Range: [0, 4095];Format 12.0;BLC value for R channel */
    GK_U16  u16BLCOffsetGr; /* RW; Range: [0, 4095];Format 12.0;BLC value for Gr channel */
    GK_U16  u16BLCOffsetGb; /* RW; Range: [0, 4095];Format 12.0;BLC value for Gb channel */
    GK_U16  u16BLCOffsetB; /* RW; Range: [0, 4095];Format 12.0;BLC value for B channel */
} ISP_MLSC_CALIBRATION_CFG_S;

typedef struct ISP_MESH_SHADING_TABLE_S {
    GK_U8   u8MeshScale;       /* RW; Range:[0, 7];Format:3.0;Three bit value that selects the scale and precision for the 10 bit gain coefficients stored in mesh tables */
    GK_U16  au16XGridWidth[(ISP_LSC_GRID_COL - 1) / 2]; /* RW; Range:GK7608V200=[4, 16323]| GK7606V100=[4, 16323]| V100=[4, 16323]| V200=[4, 16323]| V300=[4, 16323] |
                                                            GK7205V200 = [4,255]|GK7205V300 =[4,255]| GK7202V300 = [0,255 ]| GK7605V100 = [0,255 ];
                                                            limited Range:[4, u16ImgWidth /4 - 60],Member used to store the width data of each GRID partition */
    GK_U16  au16YGridWidth[(ISP_LSC_GRID_ROW - 1) / 2]; /* RW; GK7608V200=[4, 16323]| GK7606V100=[4, 16323]| V100=[4, 16323]| V200=[4, 16323]| V300=[4, 16323]|
                                                            GK7205V200 = [4,255]|GK7205V300 =[4,255]| GK7202V300 = [0,255 ]|GK7605V100 = [0,255 ];
                                                            limited Range:[4, u16ImgHeight /4 - 60],Member used to store the height data of each GRID partition */
    ISP_SHADING_GAIN_LUT_S stLscGainLut;
    ISP_BNR_LSC_GAIN_LUT_S stBNRLscGainLut; /* Not support for GK7608V200/GK7606V100/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_MESH_SHADING_TABLE_S;

/* Only used for GK7608V200/GK7606V100 */
typedef struct ISP_RADIAL_SHADING_ATTR_S {
    GK_BOOL bEnable;          /* RW; Range:[0, 1];Format:1.0; GK_TRUE: enable rlsc; GK_FALSE: disable rlsc,Only used for GK7608V200/GK7606V100 */
    GK_U16  u16RadialStr;     /* RW; Range:[0, 65535];Format:4.12; the strength of the mesh shading correction,Only used for GK7608V200/GK7606V100 */
} ISP_RADIAL_SHADING_ATTR_S;

/* Only used for GK7608V200/GK7606V100 */
typedef struct ISP_RADIAL_SHADING_LUT_S {
    GK_U16  au16RGain[ISP_RLSC_POINTS];  /* RW; Range:[0,65535];Member used to store the calibration data of the R channel required for RLSC.Only used for GK7608V200/GK7606V100 */
    GK_U16  au16GrGain[ISP_RLSC_POINTS]; /* RW; Range:[0,65535];Member used to store the calibration data of the Gr channel required for RLSC.Only used for GK7608V200/GK7606V100 */
    GK_U16  au16GbGain[ISP_RLSC_POINTS]; /* RW; Range:[0,65535];Member used to store the calibration data of the Gb channel required for RLSC.Only used for GK7608V200/GK7606V100 */
    GK_U16  au16BGain[ISP_RLSC_POINTS];  /* RW; Range:[0,65535];Member used to store the calibration data of the B channel required for RLSC.Only used for GK7608V200/GK7606V100 */
} ISP_RADIAL_SHADING_GAIN_LUT_S;

/* Only used for GK7608V200/GK7606V100 */
typedef struct ISP_RADIAL_SHADING_LUT_ATTR_S {
    OPERATION_MODE_E enLightMode;   /* RW; Range:[0, 1];Format:1.0; GK_TRUE: manual mode; GK_FALSE: auto mode.Only used for GK7608V200/GK7606V100 */
    GK_U16  u16BlendRatio;          /* RW; Range:[0, 256];Format:8.0; Used in manual mode only, indicates the light blending strength for the first light info.Only used for GK7608V200/GK7606V100 */
    GK_U8   u8LightType1;           /* RW; Range:[0, 2];Format:2.0; Used in manual mode only, indicates the first light source selected.Only used for GK7608V200/GK7606V100 */
    GK_U8   u8LightType2;           /* RW; Range:[0, 2];Format:2.0; Used in manual mode only, indicates the second light source selected.Only used for GK7608V200/GK7606V100 */
    GK_U8   u8RadialScale;          /* RW; Range:[0, 13];Format:4.0;Four bit value that selects the scale and precision for the 10 bit gain coefficients.Only used for GK7608V200/GK7606V100 */
    GK_U16  u16CenterRX;     /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Width], shows x value of the position of optical center of red channel.Only used for GK7608V200/GK7606V100 */
    GK_U16  u16CenterRY;     /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Height], shows y value of the position of optical center of red channel.Only used for GK7608V200/GK7606V100 */
    GK_U16  u16CenterGrX;    /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Width], shows x value of the position of optical center of gr channel.Only used for GK7608V200/GK7606V100 */
    GK_U16  u16CenterGrY;    /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Height], shows y value of the position of optical center of gr channel.Only used for GK7608V200/GK7606V100 */
    GK_U16  u16CenterGbX;    /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Width], shows x value of the position of optical center of gb channel.Only used for GK7608V200/GK7606V100 */
    GK_U16  u16CenterGbY;    /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Height], shows y value of the position of optical center of gb channel.Only used for GK7608V200/GK7606V100 */
    GK_U16  u16CenterBX;     /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Width], shows x value of the position of optical center of blue channel.Only used for GK7608V200/GK7606V100 */
    GK_U16  u16CenterBY;     /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Height], shows y value of the position of optical center of blue channel.Only used for GK7608V200/GK7606V100 */
    GK_U16  u16OffCenterR;   /* RW; Range:[0, 65535];Format:16.0;related to the 1/R^2 value of red channel.Only used for GK7608V200/GK7606V100 */
    GK_U16  u16OffCenterGr;  /* RW; Range:[0, 65535];Format:16.0;related to the 1/R^2 value of gr channel.Only used for GK7608V200/GK7606V100 */
    GK_U16  u16OffCenterGb;  /* RW; Range:[0, 65535];Format:16.0;related to the 1/R^2 value of gb channel.Only used for GK7608V200/GK7606V100 */
    GK_U16  u16OffCenterB;   /* RW; Range:[0, 65535];Format:16.0;related to the 1/R^2 value of blue channel.Only used for GK7608V200/GK7606V100 */
    ISP_RADIAL_SHADING_GAIN_LUT_S astRLscGainLut[3]; /* Only used for GK7608V200/GK7606V100 */
} ISP_RADIAL_SHADING_LUT_ATTR_S;

typedef struct ISP_NR_MANUAL_ATTR_S {
    GK_U8   au8ChromaStr[ISP_BAYER_CHN_NUM];   /* RW;Range:[0x0,0x3];Format:2.0;Strength of Chrmoa noise reduction for R/Gr/Gb/B channel,Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8   u8FineStr;                         /* RW;Range:[0x0,0x80];Format:8.0;Strength of Luma noise reduction */
    GK_U16  u16CoringWgt;                      /* RW;Range:[0x0,0xc80];Format:12.0;Strength of reserving the random noise */
    GK_U16  au16CoarseStr[ISP_BAYER_CHN_NUM];  /* RW;Range:[0x0,0x360];Format:10.0; Coarse Strength of noise reduction */
} ISP_NR_MANUAL_ATTR_S;

typedef struct ISP_NR_AUTO_ATTR_S {
    GK_U8   au8ChromaStr[ISP_BAYER_CHN_NUM][ISP_AUTO_ISO_STRENGTH_NUM];  /* RW;Range:[0x0,0x3];Format:2.0; Strength of chrmoa noise reduction for R/Gr/Gb/B channel,Not support for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8   au8FineStr[ISP_AUTO_ISO_STRENGTH_NUM];                       /* RW;Range:[0x0,0x80];Format:8.0; Strength of luma noise reduction */
    GK_U16  au16CoringWgt[ISP_AUTO_ISO_STRENGTH_NUM];                    /* RW;Range:[0x0,0xc80];Format:12.0; Strength of reserving the random noise */
    GK_U16  au16CoarseStr[ISP_BAYER_CHN_NUM][ISP_AUTO_ISO_STRENGTH_NUM]; /* RW;Range:[0x0,0x360];Format:10.0; Coarse Strength of noise reduction */
} ISP_NR_AUTO_ATTR_S;

typedef struct ISP_NR_WDR_ATTR_S {
    GK_U8    au8WDRFrameStr[WDR_MAX_FRAME_NUM];       /* RW;Range:[0x0,0x50];Format:7.0; Strength of each frame in wdr mode */
    GK_U8    au8FusionFrameStr[WDR_MAX_FRAME_NUM];    /* RW;Range:[0x0,0x50];Format:7.0; Strength of each frame in wdr mode. Only used for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_NR_WDR_ATTR_S;

typedef struct ISP_NR_ATTR_S {
    GK_BOOL  bEnable;                                     /* RW;Range:[0x0,0x1];Format:1.0; Nr Enable */
    GK_BOOL  bLowPowerEnable;                             /* RW;Range:[0x0,0x1];Format:1.0; Nr Low Power Enable. Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_BOOL  bNrLscEnable;                                /* RW;Range:[0x0,0x1];Format:1.0; GK_TRUE: Noise reduction refers to lens shading; GK_FALSE: Noise reduction not refers to lens shading; */
    GK_U8    u8NrLscRatio;                                /* RW;Range:[0x0,0xff];Format:8.0; Ratio of referring to lens shading. Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8    u8BnrLscMaxGain;                             /* RW;Range:[0x0,0xbf];Format:2.6; Max gain for referring to lens shading.Only used for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16   u16BnrLscCmpStrength;                        /* RW;Range:[0x0,0x100];Format:1.8; Compare strength for referring to lens shading.Only used for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16   au16CoringRatio[ISP_BAYERNR_LUT_LENGTH];  /* RW;Range:[0x0,0x3ff];Format:12.0; Strength of reserving the random noise according to luma */

    ISP_OP_TYPE_E enOpType;
    ISP_NR_AUTO_ATTR_S stAuto;
    ISP_NR_MANUAL_ATTR_S stManual;
    ISP_NR_WDR_ATTR_S  stWdr;
} ISP_NR_ATTR_S;

/* Only used for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
typedef struct ISP_DE_MANUAL_ATTR_S {
    GK_U16       u16GlobalGain;         /* RW;Range:[0x0,0x100];Format:1.8; Only used for  V100/ V200/ V300 */
    GK_U16       u16GainLF;             /* RW;Range:[0x0,0x20];Format:2.4; Only used for  V100/ V200/ V300 */
    GK_U16       u16GainHF;             /* RW;Range:[0x0,0x20];Format:2.4;Only used for  V100/ V200/ V300 */
} ISP_DE_MANUAL_ATTR_S;

/* Only used for  V100/ V200/ V300 */
typedef struct ISP_DE_AUTO_ATTR_S {
    GK_U16       au16GlobalGain[ISP_AUTO_ISO_STRENGTH_NUM];         /* RW;Range:[0x0,0x100];Format:1.8; Only used for  V100/ V200/ V300 */
    GK_U16       au16GainLF[ISP_AUTO_ISO_STRENGTH_NUM];             /* RW;Range:[0x0,0x20];Format:2.4; Only used for  V100/ V200/ V300 */
    GK_U16       au16GainHF[ISP_AUTO_ISO_STRENGTH_NUM];             /* RW;Range:[0x0,0x20];Format:2.4; Only used for  V100/ V200/ V300 */
} ISP_DE_AUTO_ATTR_S;


/* Only used for  V100/ V200/ V300 */
typedef struct ISP_DE_ATTR_S {
    GK_BOOL       bEnable;                                    /* RW;Range:[0x0,0x1];Format:1.0; De Enable,Only used for  V100/ V200/ V300 */
    GK_U16        au16LumaGainLut[ISP_DE_LUMA_GAIN_LUT_N]; /* RW;Range:[0x0,0x100];Format:1.8; Only used for  V100/ V200/ V300 */

    ISP_OP_TYPE_E        enOpType;
    ISP_DE_AUTO_ATTR_S   stAuto;
    ISP_DE_MANUAL_ATTR_S stManual;
} ISP_DE_ATTR_S;

#define ISP_CVTMAT_NUM                            12
#define ISP_EXP_CTRL_NUM                          2

/* Only support GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
typedef enum ISP_IRBAYER_FORMAT_E {
    IRBAYER_GRGBI = 0,
    IRBAYER_RGBGI = 1,
    IRBAYER_GBGRI = 2,
    IRBAYER_BGRGI = 3,
    IRBAYER_IGRGB = 4,
    IRBAYER_IRGBG = 5,
    IRBAYER_IBGRG = 6,
    IRBAYER_IGBGR = 7,
    IRBAYER_BUTT

} ISP_IRBAYER_FORMAT_E;

/* Only support GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
typedef enum ISP_IR_CVTMAT_MODE_E {
    ISP_IR_CVTMAT_MODE_NORMAL = 0,
    ISP_IR_CVTMAT_MODE_MONO,
    ISP_IR_CVTMAT_MODE_USER,
    ISP_IR_CVTMAT_MODE_BUTT

} ISP_IR_CVTMAT_MODE_E;

/* Only support GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
typedef struct ISP_RGBIR_ATTR_S {
    GK_BOOL              bEnable    ;      /* RW;Range:[0x0,0x1];Format:1.0; Enable/Disable RGBIR module,Only support GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    ISP_IRBAYER_FORMAT_E enInPattern;      /* RW;Range:[0x0,0x7];Format:3.0; IR pattern of the input signal,Only support GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    ISP_BAYER_FORMAT_E   enOutPattern;     /* RW;Range:[0x0,0x3];Format:2.0; Bayer pattern of the output signal,Only support GK7205V200/GK7205V300/GK7202V300/GK7605V100 */

    GK_U16               au16ExpCtrl[ISP_EXP_CTRL_NUM];    /* RW;Range:[0, 2047];Format:11.0; Over expose control parameter,Only support GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16               au16Gain[ISP_EXP_CTRL_NUM];       /* RW;Range:[0, 511];Format:9.0; Over expose control parameter,Only support GK7205V200/GK7205V300/GK7202V300/GK7605V100 */

    ISP_IR_CVTMAT_MODE_E enIRCvtMatMode;
    GK_S16               as16CvtMatrix[ISP_CVTMAT_NUM]; /* RW;Range:[-32768, 32767];Format:s15.0; RGBIR to Bayer image Convert matrix coefficients(need calibration),Only support GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_RGBIR_ATTR_S;

/*
Defines the type of the ISP gamma curve
0 = Default curve
1 = Default BT.709 curve (Gamma Curve)
2 = Default SMPTE.2084 curve (PQ Curve), Only used for GK7608V200
3 = User defined Gamma curve, LUT must be correct
*/
typedef enum ISP_GAMMA_CURVE_TYPE_E {
    ISP_GAMMA_CURVE_DEFAULT = 0x0,
    ISP_GAMMA_CURVE_SRGB,
    ISP_GAMMA_CURVE_HDR,    /* Only used for GK7608V200 */
    ISP_GAMMA_CURVE_USER_DEFINE,
    ISP_GAMMA_CURVE_BUTT
} ISP_GAMMA_CURVE_TYPE_E;
typedef struct ISP_GAMMA_ATTR_S {
    GK_BOOL   bEnable;                     /* RW; Range:[0, 1]; Format:1.0;Enable/Disable Gamma Function */
    GK_U16    u16Table[GAMMA_NODE_NUM];    /* RW; Range:[0, 4095]; Format:12.0;Gamma LUT nodes value */

    ISP_GAMMA_CURVE_TYPE_E enCurveType;    /* RW; Range:[0, 3]; Format:2.0;Gamma curve type */
} ISP_GAMMA_ATTR_S;

/*  */
typedef struct ISP_PREGAMMA_ATTR_S {
    GK_BOOL   bEnable;                         /* RW; Range:[0, 1]; Format:1.0;Enable/Disable PreGamma Function. */
    GK_U32    au32Table[PREGAMMA_NODE_NUM];    /* RW; Range:GK7608V200 = [0, 0x100000] | GK7606V100 = [0, 0x100000] |  V100 = [0, 0xFFFFF] | V200 = [0, 0xFFFFF] |
                                                  V300 = [0, 0xFFFFF] |GK7205V200 = [0x0, 0xFFFFF]|GK7205V300 = [0x0, 0xFFFFF]|GK7202V300 = [0x0,0xFFFFF]|GK7605V100 = [0x0,0xFFFFF];
                                                 Format:21.0;PreGamma LUT nodes value. */
} ISP_PREGAMMA_ATTR_S;

typedef struct ISP_PRELOGLUT_ATTR_S {
    GK_BOOL                 bEnable;    /* RW; Range:[0, 1]; Format:1.0;Enable/Disable PreLogLUT Function.Not support for  V100/ V200/ V300 */
} ISP_PRELOGLUT_ATTR_S;

typedef struct ISP_LOGLUT_ATTR_S {
    GK_BOOL                 bEnable;    /* RW; Range:[0, 1]; Format:1.0;Enable/Disable LogLUT Function.Not support for  V100/ V200/ V300 */
} ISP_LOGLUT_ATTR_S;

#define     ISP_SHARPEN_FREQ_CORING_LENGTH      (8)
#define     SHRP_GAIN_LUT_SIZE                  (64)

typedef struct ISP_SHARPEN_MANUAL_ATTR_S {
    GK_U8  au8LumaWgt[ISP_SHARPEN_LUMA_NUM];     /* RW; Range: GK7608V200 =[0,127]|GK7606V100=[0,127]| V100 = [0, 127]| V200 =[0, 127]|
                                                     V300 =[0, 127] | GK7205V200 = [0x0, 31]|GK7205V300 = [0x0, 31]|GK7202V300 = [0x0, 31]|GK7605V100 = [0x0, 31];
                                                    Format:0.7;Adjust the sharpen strength according to luma. Sharpen strength will be weaker when it decrease. */
    GK_U16 au16TextureStr[ISP_SHARPEN_GAIN_NUM]; /* RW; Range: [0, 4095]; Format:7.5;Undirectional sharpen strength for texture and detail enhancement */
    GK_U16 au16EdgeStr[ISP_SHARPEN_GAIN_NUM];    /* RW; Range: [0, 4095]; Format:7.5;Directional sharpen strength for edge enhancement */
    GK_U16 u16TextureFreq;         /* RW; Range: [0, 4095];Format:6.6; Texture frequency adjustment. Texture and detail will be finer when it increase */
    GK_U16 u16EdgeFreq;            /* RW; Range: [0, 4095];Format:6.6; Edge frequency adjustment. Edge will be narrower and thiner when it increase */
    GK_U8  u8OverShoot;            /* RW; Range: [0, 127]; Format:7.0;u8OvershootAmt */
    GK_U8  u8UnderShoot;           /* RW; Range: [0, 127]; Format:7.0;u8UndershootAmt */
    GK_U8  u8ShootSupStr;          /* RW; Range: [0, 255]; Format:8.0;overshoot and undershoot suppression strength, the amplitude and width of shoot will be decrease when shootSupSt increase */
    GK_U8  u8ShootSupAdj;          /* RW; Range: [0, 15]; Format:4.0;overshoot and undershoot suppression adjusting, adjust the edge shoot suppression strength */
    GK_U8  u8DetailCtrl;           /* RW; Range: [0, 255]; Format:8.0;Different sharpen strength for detail and edge. When it is bigger than 128, detail sharpen strength will be stronger than edge. */
    GK_U8  u8DetailCtrlThr;        /* RW; Range: [0, 255]; Format:8.0; The threshold of DetailCtrl, it is used to distinguish detail and edge. */
    GK_U8  u8EdgeFiltStr;          /* RW; Range: [0, 63]; Format:6.0;The strength of edge filtering. */
    GK_U8  u8EdgeFiltMaxCap;       /* RW; Range: [0, 47]; Format:6.0;The max capacity of edge filtering.*/
    GK_U8  u8RGain;                /* RW; Range: [0, 31];   Format:5.0;Sharpen Gain for Red Area */
    GK_U8  u8GGain;                /* RW; Range: [0, 255]; Format:8.0; Sharpen Gain for Green Area */
    GK_U8  u8BGain;                /* RW; Range: [0, 31];   Format:5.0;Sharpen Gain for Blue Area */
    GK_U8  u8SkinGain;             /* RW; Range: [0, 31]; Format:5.0;Sharpen Gain for Skin Area */
    GK_U16  u16MaxSharpGain;       /* RW; Range: [0, 0x7FF]; Format:8.3; Maximum sharpen gain */
    GK_U8  u8WeakDetailGain;       /* RW; Range: [0, 127];  Only support for GK7205V200/GK7205V300/GK7202V300/GK7605V100; sharpen Gain for weakdetail */
} ISP_SHARPEN_MANUAL_ATTR_S;


typedef struct ISP_SHARPEN_AUTO_ATTR_S {
    GK_U8  au8LumaWgt[ISP_SHARPEN_LUMA_NUM][ISP_AUTO_ISO_STRENGTH_NUM];      /* RW; Range:GK7608V200 =[0,127]|GK7606V100=[0,127]| V100 = [0, 127]|
                                                                                 V200 =[0, 127]|   V300 =[0, 127]| GK7205V200 = [0x0, 31]|GK7205V300 = [0x0, 31]|GK7202V300 = [0x0, 31]|GK7605V100 = [0x0, 31]
                                                                                Format:0.7; Adjust the sharpen strength according to luma. Sharpen strength will be weaker when it decrease. */
    GK_U16 au16TextureStr[ISP_SHARPEN_GAIN_NUM][ISP_AUTO_ISO_STRENGTH_NUM];  /* RW; Range: [0, 4095]; Format:7.5;Undirectional sharpen strength for texture and detail enhancement */
    GK_U16 au16EdgeStr[ISP_SHARPEN_GAIN_NUM][ISP_AUTO_ISO_STRENGTH_NUM];     /* RW; Range: [0, 4095]; Format:7.5;Directional sharpen strength for edge enhancement */
    GK_U16 au16TextureFreq[ISP_AUTO_ISO_STRENGTH_NUM];   /* RW; Range: [0, 4095]; Format:6.6;Texture frequency adjustment. Texture and detail will be finer when it increase */
    GK_U16 au16EdgeFreq[ISP_AUTO_ISO_STRENGTH_NUM];      /* RW; Range: [0, 4095]; Format:6.6;Edge frequency adjustment. Edge will be narrower and thiner when it increase */
    GK_U8  au8OverShoot[ISP_AUTO_ISO_STRENGTH_NUM];      /* RW; Range: [0, 127];  Format:7.0;u8OvershootAmt */
    GK_U8  au8UnderShoot[ISP_AUTO_ISO_STRENGTH_NUM];     /* RW; Range: [0, 127];  Format:7.0;u8UndershootAmt */
    GK_U8  au8ShootSupStr[ISP_AUTO_ISO_STRENGTH_NUM];    /* RW; Range: [0, 255]; Format:8.0;overshoot and undershoot suppression strength, the amplitude and width of shoot will be decrease when shootSupSt increase */
    GK_U8  au8ShootSupAdj[ISP_AUTO_ISO_STRENGTH_NUM];    /* RW; Range: [0, 15]; Format:4.0;overshoot and undershoot suppression adjusting, adjust the edge shoot suppression strength */
    GK_U8  au8DetailCtrl[ISP_AUTO_ISO_STRENGTH_NUM];     /* RW; Range: [0, 255]; Format:8.0;Different sharpen strength for detail and edge. When it is bigger than 128, detail sharpen strength will be stronger than edge. */
    GK_U8  au8DetailCtrlThr[ISP_AUTO_ISO_STRENGTH_NUM];  /* RW; Range: [0, 255]; Format:8.0; The threshold of DetailCtrl, it is used to distinguish detail and edge. */
    GK_U8  au8EdgeFiltStr[ISP_AUTO_ISO_STRENGTH_NUM];    /* RW; Range: [0, 63]; Format:6.0;The strength of edge filtering. */
    GK_U8  au8EdgeFiltMaxCap[ISP_AUTO_ISO_STRENGTH_NUM];  /* RW; Range: [0, 47]; Format:6.0;The max capacity of edge filtering.*/
    GK_U8  au8RGain[ISP_AUTO_ISO_STRENGTH_NUM];                 /* RW; Range: [0, 31];   Format:5.0; Sharpen Gain for Red Area */
    GK_U8  au8GGain[ISP_AUTO_ISO_STRENGTH_NUM];                 /* RW; Range: [0, 255]; Format:8.0; Sharpen Gain for Green Area */
    GK_U8  au8BGain[ISP_AUTO_ISO_STRENGTH_NUM];                 /* RW; Range: [0, 31];   Format:5.0; Sharpen Gain for Blue Area */
    GK_U8  au8SkinGain[ISP_AUTO_ISO_STRENGTH_NUM];       /* RW; Range: [0, 31]; Format:5.0;Sharpen Gain for Skin Area */
    GK_U16  au16MaxSharpGain[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range: [0, 0x7FF]; Format:8.3; Maximum sharpen gain */
    GK_U8  au8WeakDetailGain[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range: [0, 127]; Format:7.0; Only support for GK7205V200/GK7205V300/GK7202V300/GK7605V100; sharpen Gain for weakdetail */
} ISP_SHARPEN_AUTO_ATTR_S;

typedef struct ISP_SHARPEN_ATTR_S {
    GK_BOOL bEnable;    /* RW; Range:[0, 1]; Format:1.0;Enable/Disable sharpen module */
    GK_U8 u8SkinUmin;   /* RW; Range: [0, 255];  Format:8.0; U min value of the range of skin area */
    GK_U8 u8SkinVmin;   /* RW; Range: [0, 255];  Format:8.0; V min value of the range of skin area */
    GK_U8 u8SkinUmax;   /* RW; Range: [0, 255];  Format:8.0; U max value of the range of skin area */
    GK_U8 u8SkinVmax;   /* RW; Range: [0, 255];  Format:8.0; V max value of the range of skin area */
    ISP_OP_TYPE_E enOpType;
    ISP_SHARPEN_MANUAL_ATTR_S stManual;
    ISP_SHARPEN_AUTO_ATTR_S   stAuto;
} ISP_SHARPEN_ATTR_S;

/* /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
typedef struct ISP_EDGEMARK_ATTR_S {
    GK_BOOL bEnable;              /* RW; Range:[0, 1]; Format:1.0;Enable/Disable Edge Mark. /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8   u8Threshold;          /* RW; Range: [0, 255];  Format:8.0;/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U32  u32Color;             /* RW; Range: [0, 0xFFFFFF];  Format:32.0;/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_EDGEMARK_ATTR_S;

// High Light Constraint
/* Not support for GK7608V200/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
typedef struct ISP_HLC_ATTR_S {
    GK_BOOL bEnable;              /* RW; Range:[0, 1];  Format:1.0;Enable/Disable HLC module,Only used for GK7606V100/ V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8   u8LumaThr;            /* RW; Range:[0, 255];Format:8.0;Only used for GK7606V100/ V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8   u8LumaTarget;         /* RW; Range:[0, 255];Format:8.0;Only used for GK7606V100/ V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_HLC_ATTR_S;

/* Crosstalk Removal */
typedef struct ISP_CR_ATTR_S {
    GK_BOOL  bEnable;       /* RW; Range: [0, 1];Format 1.0;Enable/disable the crosstalk removal module */
    GK_U8    u8Slope;       /* RW; Range: GK7608V200 = [0, 14] | GK7606V100 = [0, 14]| V100 = [0, 14]| V200 =[0, 14] | V300 =[0, 14] |
                                                   GK7205V200 = [0,16]|GK7205V300 = [0,16]|GK7202V300 = [0,16]|GK7605V100 = [0,16];
                                                   Crosstalk slope value. */
    GK_U8    u8SensiSlope;  /* RW; Range: GK7608V200 = [0, 14] | GK7606V100 = [0, 14]| V100 = [0, 14]| V200 =[0, 14]|| V300 =[0, 14] |
                                                   GK7205V200 = [0,16]|GK7205V300 = [0,16]|GK7202V300 = [0,16]|GK7605V100 = [0,16];
                                                   Crosstalk sensitivity. */
    GK_U16   u16SensiThr;   /* RW; Range: GK7608V200 = [0, 16383] | GK7606V100 = [0, 16383]| V100 = [0, 16383]| V200 =[0, 16383]| V300 =[0, 16383]|
                                                   GK7205V200 = [0,65535]|GK7205V300 = [0,65535]|GK7202V300 = [0,65535]|GK7605V100 = [0,65535];
                                                   Crosstalk sensitivity threshold. */
    GK_U16   au16Strength[ISP_AUTO_ISO_STRENGTH_NUM];   /* RW; Range: [0,256];Crosstalk strength value. */
    GK_U16   au16Threshold[ISP_AUTO_ISO_STRENGTH_NUM];  /* RW; Range: GK7608V200 = [0, 16383] | GK7606V100 = [0, 16383]| V100 = [0, 16383]| V200 =[0, 16383] |
                                                                                                   V300 =[0, 16383]|GK7205V200 = [0,65535]|
                                                                                                  GK7205V300 = [0,65535]|GK7202V300 = [0,65535]|GK7605V100 = [0,65535]; Crosstalk threshold. */
    GK_U16   au16NpOffset[ISP_AUTO_ISO_STRENGTH_NUM];   /* RW; Range: GK7608V200 = [512, 16383] | GK7606V100 = [512, 16383]| V100 = [512, 16383]|
                                                                                                   V200 =[512, 16383] | V300 =[512, 16383] |
                                                                                                  GK7205V200 = [8192,65535]|GK7205V300 = [8192,65535]|GK7202V300 = [8192,65535]|GK7605V100 = [8192,65535];  Set Noise profile value. */
} ISP_CR_ATTR_S;

typedef struct ISP_ANTIFALSECOLOR_MANUAL_ATTR_S {
    GK_U8    u8AntiFalseColorThreshold;     /* RW;Range:[0x0,0x20];Format:6.0;Threshold for antifalsecolor */
    GK_U8    u8AntiFalseColorStrength;      /* RW;Range:[0x0,0x1F];Format:5.0;Strength of antifalsecolor */
} ISP_ANTIFALSECOLOR_MANUAL_ATTR_S;

typedef struct ISP_ANTIFALSECOLOR_AUTO_ATTR_S {
    GK_U8   au8AntiFalseColorThreshold[ISP_AUTO_ISO_STRENGTH_NUM];    /* RW;Range:[0x0,0x20];Format:6.0;Threshold for antifalsecolor */
    GK_U8   au8AntiFalseColorStrength[ISP_AUTO_ISO_STRENGTH_NUM];     /* RW;Range:[0x0,0x1F];Format:5.0;Strength of antifalsecolor */
} ISP_ANTIFALSECOLOR_AUTO_ATTR_S;

typedef struct ISP_ANTIFALSECOLOR_ATTR_S {
    GK_BOOL  bEnable;                               /* RW;Range:[0x0,0x1];Format:1.0; AntiFalseColor Enable */
    ISP_OP_TYPE_E enOpType;
    ISP_ANTIFALSECOLOR_AUTO_ATTR_S stAuto;
    ISP_ANTIFALSECOLOR_MANUAL_ATTR_S stManual;
} ISP_ANTIFALSECOLOR_ATTR_S;

typedef struct ISP_DEMOSAIC_MANUAL_ATTR_S {
    GK_U8   u8NonDirStr;            /* RW; Range:[0x0, 0xFF]; Format:4.4; Non-direction strength */
    GK_U8   u8NonDirMFDetailEhcStr; /* RW; Range:GK7608V200 = [0x0, 0x10] |GK7606V100 = [0x0, 0x7f] | V100= [0x0, 0x7f]| V200= [0x0, 0x7f]|
                                                                V300= [0x0, 0x7f]|
                                                               GK7205V200 = [0x0, 0x7f]|GK7205V300 = [0x0, 0x7f]|GK7202V300 = [0x0, 0x7f]|GK7605V100 = [0x0, 0x7f];
                                                               Format:3.4; Non-direction medium frequent detail enhance  strength */
    GK_U8   u8NonDirHFDetailEhcStr; /* RW; Range:[0x0,0x10];  Format:2.2; Non-direction high frequent detail enhance strength */
    GK_U8   u8DetailSmoothRange;    /* RW; Range:GK7608V200 = [0x1, 0x8] |GK7606V100 = [0x1, 0x7] | V100 = [0x1, 0x7]| V200 = [0x1, 0x7]|
                                                                 V300 = [0x1, 0x7] |
                                                                GK7205V200 = [0x1, 0x7]|GK7205V300 = [0x1, 0x7]|GK7202V300 = [0x1, 0x7]|GK7605V100 = [0x1, 0x7];
                                                                Format:4.0; Detail smooth range */
    GK_U16  u16DetailSmoothStr;     /* RW;Range:[0x0,0x100]; Format:9.0;   Strength of detail smooth, Only used for GK7608V200 */
	GK_U8   u8ColorNoiseThdF;       /* RW;Range:[0x0,0xFF]; Format:8.0;   Frequency Threshold used for ColorNoise */
    GK_U8   u8ColorNoiseStrF;       /* RW;Range:[0x0,0x8]; Format:4.0;   Frequency Strength used for ColorNoise */
    GK_U8   u8ColorNoiseThdY;       /* RW;Range:[0x0,0xF];Format:4.0; Range of color denoise luma*/
    GK_U8   u8ColorNoiseStrY;       /* RW;Range:[0x0,0x3F];Format:6.0; Strength of color denoise luma*/
} ISP_DEMOSAIC_MANUAL_ATTR_S;

typedef struct ISP_DEMOSAIC_AUTO_ATTR_S {
    GK_U8   au8NonDirStr[ISP_AUTO_ISO_STRENGTH_NUM];            /* RW; Range:[0x0, 0xFF]; Format:4.4; Non-direction strength */
    GK_U8   au8NonDirMFDetailEhcStr[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range:GK7608V200 = [0x0, 0x10] |GK7606V100 = [0x0, 0x7f] | V100= [0x0, 0x7f]|
                                                                   V200= [0x0, 0x7f]| V300= [0x0, 0x7f] |
                                                                  GK7205V200= [0x0, 0x7f]|GK7205V300 = [0x0, 0x7f] |GK7202V300= [0x0, 0x7f]|GK7605V100 = [0x0, 0x7f];
                                                                  Format:3.4; Non-direction medium frequent detail enhance  strength */
    GK_U8   au8NonDirHFDetailEhcStr[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range:[0x0,0x10];  Format:2.2; Non-direction high frequent detail enhance  strength */
    GK_U8   au8DetailSmoothRange[ISP_AUTO_ISO_STRENGTH_NUM];    /* RW; Range:GK7608V200 = [0x1, 0x8] |GK7606V100 = [0x1, 0x7] | V100 = [0x1, 0x7]|
                                                                   V200 = [0x1, 0x7]| V300 = [0x1, 0x7] |
                                                                  GK7205V200= [0x1, 0x7]|GK7205V300 = [0x, 0x7] |GK7202V300= [0x1, 0x7]|GK7605V100= [0x1, 0x7] ;
                                                                  Format:4.0; Detail smooth range */
    GK_U16  au16DetailSmoothStr[ISP_AUTO_ISO_STRENGTH_NUM];     /* RW;Range:[0x0,0x100]; Format:9.0;   Strength of detail smooth, Only used for GK7608V200 */
	GK_U8   au8ColorNoiseThdF[ISP_AUTO_ISO_STRENGTH_NUM];       /* RW;Range:[0x0,0xFF]; Format:8.0;   Frequency Threshold used for ColorNoise */
    GK_U8   au8ColorNoiseStrF[ISP_AUTO_ISO_STRENGTH_NUM];       /* RW;Range:[0x0,0x8]; Format:4.0;   Frequency Strength used for ColorNoise */
    GK_U8   au8ColorNoiseThdY[ISP_AUTO_ISO_STRENGTH_NUM];       /* RW;Range:[0x0,0xF];Format:4.0; Range of color denoise luma*/
    GK_U8   au8ColorNoiseStrY[ISP_AUTO_ISO_STRENGTH_NUM];       /* RW;Range:[0x0,0x3F];Format:6.0; Strength of color denoise luma*/
} ISP_DEMOSAIC_AUTO_ATTR_S;

typedef struct ISP_DEMOSAIC_ATTR_S {
    GK_BOOL bEnable;        /* RW; Range:[0, 1]; Format:1.0;Enable/Disable demosaic module */
    ISP_OP_TYPE_E enOpType;
    ISP_DEMOSAIC_MANUAL_ATTR_S stManual;
    ISP_DEMOSAIC_AUTO_ATTR_S stAuto;
} ISP_DEMOSAIC_ATTR_S;

/* Defines the attributes of the ISP black level */
typedef struct ISP_BLACK_LEVEL_S {
    ISP_OP_TYPE_E enOpType;
    GK_U16 au16BlackLevel[ISP_BAYER_CHN_NUM]; /* RW; Range: [0x0, 0xFFF];Format:12.0;Black level values that correspond to the black levels of the R,Gr, Gb, and B components respectively. */
} ISP_BLACK_LEVEL_S;

/*
Defines the FPN removal type
0 = Frame mode correction
1 = Line mode correction
*/
typedef enum ISP_FPN_TYPE_E {
    ISP_FPN_TYPE_FRAME = 0,
    ISP_FPN_TYPE_LINE = 1,
    ISP_FPN_TYPE_BUTT
} ISP_FPN_TYPE_E;

/* Defines the information about calibrated black frames.  */
typedef struct ISP_FPN_FRAME_INFO_S {
    GK_U32              u32Iso;             /* RW;Range:[0x64,0xFFFFFFFF];Format:32.0;FPN CALIBRATE ISO */
    GK_U32              u32Offset[VI_MAX_SPLIT_NODE_NUM];          /* RW;Range:[0,0xFFF];Format:12.0;FPN frame u32Offset (agv pixel value) */
    GK_U32              u32FrmSize;         /* RW;FPN frame size (exactly frm size or compress len) */
    VIDEO_FRAME_INFO_S  stFpnFrame;         /* FPN frame info, 8bpp,10bpp,12bpp,16bpp. Compression or not */
} ISP_FPN_FRAME_INFO_S;

/* Defines the calibration attribute of the FPN removal module.  */
typedef struct ISP_FPN_CALIBRATE_ATTR_S {
    GK_U32                          u32Threshold;        /* RW;Range:[1,0xFFF];Format:12.0;pix value > threshold means defective pixel */
    GK_U32                          u32FrameNum;         /* RW;Range:[1, 16];Format:5.0;Number of frames to be calibrated. The value range is {1, 2, 4, 8, 16},that is, the integer exponentiation of 2. */
    ISP_FPN_TYPE_E                  enFpnType;           /* frame mode or line mode */
    ISP_FPN_FRAME_INFO_S            stFpnCaliFrame;
} ISP_FPN_CALIBRATE_ATTR_S;
/* Defines the manual correction attribute of the FPN removal module.  */
typedef struct ISP_FPN_MANUAL_ATTR_S {
    GK_U32               u32Strength;         /* RW;Range:[0,1023];Format:10.0;Manual correction strength */
} ISP_FPN_MANUAL_ATTR_S;

/* Defines the automatic correction attribute of the FPN removal module.  */
typedef struct ISP_FPN_AUTO_ATTR_S {
    GK_U32               u32Strength;          /* RW;Range:[0,1023];Format:10.0;Auto correction strength */
} ISP_FPN_AUTO_ATTR_S;

/* Defines the correction attribute of the FPN removal module.  */
typedef struct ISP_FPN_ATTR_S {
    GK_BOOL               bEnable;            /* RW;Range:[0,1];Format:1.0; */
    ISP_OP_TYPE_E         enOpType;           /* manual or auto mode */
    ISP_FPN_TYPE_E        enFpnType;          /* frame mode or line mode */
    ISP_FPN_FRAME_INFO_S  stFpnFrmInfo;       /* input in correction mode. */
    ISP_FPN_MANUAL_ATTR_S stManual;
    ISP_FPN_AUTO_ATTR_S   stAuto;
} ISP_FPN_ATTR_S;

/* Defines the manual dehze attribute */
typedef struct ISP_DEHAZE_MANUAL_ATTR_S {
    GK_U8              u8strength;  /* RW;Range:[0,0xFF];Format:8.0;Manual dehze strength */
} ISP_DEHAZE_MANUAL_ATTR_S;

/* Defines the automatic dehze attribute */
typedef struct ISP_DEHAZE_AUTO_ATTR_S {
    GK_U8              u8strength; /* RW;Range:[0,0xFF];Format:8.0;Weighted coefficient for automatic dehaze strength. */
} ISP_DEHAZE_AUTO_ATTR_S;

/* Defines the ISP dehaze attribute */
typedef struct ISP_DEHAZE_ATTR_S {
    GK_BOOL  bEnable;           /* RW;Range:[0,1];Format:1.0; */
    GK_BOOL  bUserLutEnable;    /* RW;Range:[0,1];0:Auto Lut 1:User Lut */
    GK_U8    au8DehazeLut[256];
    ISP_OP_TYPE_E      enOpType;
    ISP_DEHAZE_MANUAL_ATTR_S stManual;
    ISP_DEHAZE_AUTO_ATTR_S   stAuto;
    GK_U16       u16TmprfltIncrCoef; /* RW, Range: [0x0, 0x80].filter increase coeffcient. */
    GK_U16       u16TmprfltDecrCoef; /* RW, Range: [0x0, 0x80].filter decrease coeffcient. */

} ISP_DEHAZE_ATTR_S;

/* Defines purple fringing correction manual attribute */
typedef struct ISP_DEPURPLESTR_MANUAL_ATTR_S {
    GK_U8 u8DePurpleCrStr;               /* RW;Range: [0,8];Format:4.0;Correction strength of the R channel */
    GK_U8 u8DePurpleCbStr;               /* RW;Range: [0,8];Format:4.0;Correction strength of the B channel */
} ISP_DEPURPLESTR_MANUAL_ATTR_S;

/* Defines purple fringing correction automatic attribute */
typedef struct ISP_DEPURPLESTR_AUTO_ATTR_S {
    GK_U8 au8DePurpleCrStr[ISP_EXP_RATIO_STRENGTH_NUM];    /* RW;Range: [0,8];Format:4.0;Correction strength of the R channel */
    GK_U8 au8DePurpleCbStr[ISP_EXP_RATIO_STRENGTH_NUM];    /* RW;Range: [0,8];Format:4.0;Correction strength of the B channel */
} ISP_DEPURPLESTR_AUTO_ATTR_S;

/* Purple fringing detection and correction attribute */
typedef struct ISP_LOCAL_CAC_ATTR_S {
    GK_BOOL bEnable;                        /* RW;Range: [0,1];Format:1.0; GK_TRUE: enable local cac; GK_FALSE: disable local cac */
    GK_U16  u16PurpleDetRange;              /* RW;Range: [0,410];Format:9.0;Purple fringing detection scope */
    GK_U16  u16VarThr;                      /* RW;Range: [0,4095];Format:12.0;Edge detection threshold */
    GK_U16  u16RDetThr[ISP_LCAC_DET_NUM];   /* RW;Range: [0,4095];Format:12.0;Component R detection threshold, actual threshold change with PurpleDetRange */
    GK_U16  u16GDetThr[ISP_LCAC_DET_NUM];   /* RW;Range: [0,4095];Format:12.0;Component G detection threshold, actual threshold change with PurpleDetRange */
    GK_U16  u16BDetThr[ISP_LCAC_DET_NUM];   /* RW;Range: [0,4095];Format:12.0;Component B detection threshold, actual threshold change with PurpleDetRange */
    GK_U16  u16LumaDetThr[ISP_LCAC_DET_NUM];  /* RW;Range: [0,4095];Format:12.0;Component Luma detection threshold, actual threshold change with PurpleDetRange */
    GK_S16  s16CbCrRatio[ISP_LCAC_DET_NUM];  /* RW;Range: [-2048,2047];Format:S12.0; Cb/Cr ratio threshold, actual threshold change with PurpleDetRange */
    ISP_OP_TYPE_E      enOpType;            /* RW;Range: [0,1];Format:1.0;Purple fringing correction working mode */
    ISP_DEPURPLESTR_MANUAL_ATTR_S stManual;
    ISP_DEPURPLESTR_AUTO_ATTR_S   stAuto;
} ISP_LOCAL_CAC_ATTR_S;

/* Defines the lateral chromatic aberration correction attribute, /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
typedef struct ISP_GLOBAL_CAC_ATTR_S {
    GK_BOOL bEnable;            /* RW; Range: [0, 1];Format: 1.0;  enable/disable global cac */
    GK_U16  u16VerCoordinate;   /* RW; Range: [0, 8191];Format: 13.0; limited Range: [0, ImageHeight - 1],Vertical coordinate of the optical center.  /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16  u16HorCoordinate;   /* RW; Range: [0, 8191];Format: 13.0; limited range : [0, ImageWidth - 1],Horizontal coordinate of the optical center. /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_S16  s16ParamRedA;       /* RW; Range: [-256, 255];Format: 9.0; Coefficient a of the radius polynomial corresponding to channel R. /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_S16  s16ParamRedB;       /* RW; Range: [-256, 255];Format: 9.0; Coefficient b of the radius polynomial corresponding to channel R. /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_S16  s16ParamRedC;       /* RW; Range: [-256, 255];Format: 9.0; Coefficient c of the radius polynomial corresponding to channel R. /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_S16  s16ParamBlueA;      /* RW; Range: [-256, 255];Format: 9.0; Coefficient a of the radius polynomial corresponding to channel B. /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_S16  s16ParamBlueB;      /* RW; Range: [-256, 255];Format: 9.0; Coefficient b of the radius polynomial corresponding to channel B. /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_S16  s16ParamBlueC;      /* RW; Range: [-256, 255];Format: 9.0; Coefficient c of the radius polynomial corresponding to channel B. /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8   u8VerNormShift;     /* RW; Range: [0, 7];Format: 3.0; Normalized shift parameter in the vertical direction. /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8   u8VerNormFactor;    /* RW; Range: [0, 31];Format: 5.0;Normalized coefficient in the vertical direction. /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8   u8HorNormShift;     /* RW; Range: [0, 7];Format: 3.0; Normalized shift parameter in the horizontal direction. /GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8   u8HorNormFactor;    /* RW; Range: [0, 31];Format: 5.0;Normalized coefficient in the horizontal direction./GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16  u16CorVarThr;       /* RW; Range: [0, 4095];Format: 12.0;Variance threshold of lateral chromatic aberration correction./GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_GLOBAL_CAC_ATTR_S;

/* Defines the Radial Crop attribute */
typedef struct ISP_RC_ATTR_S {
    GK_BOOL bEnable;       /* RW;Range:[0,1];Format:1.0; GK_TRUE: enable ridial crop; GK_FALSE: disable ridial crop.Not support for  V100/ V200/ V300 */
    POINT_S stCenterCoor;  /* RW;the coordinate of central pixel.Not support for  V100/ V200/ V300 */
    GK_U32  u32Radius;     /* RW;Range:[0,11586];Format:14.0; when the distance to central pixel is greater than u32Radius,the pixel value becomes 0.
                                                 Not support for  V100/ V200/ V300 */
} ISP_RC_ATTR_S;

typedef struct ISP_INNER_STATE_INFO_S {

    GK_U16 au16TextureStr[ISP_SHARPEN_GAIN_NUM];     /* RW; range: [0, 4095]; Format:7.5;Undirectional sharpen strength for texture and detail enhancement */
    GK_U16 au16EdgeStr[ISP_SHARPEN_GAIN_NUM];        /* RW; range: [0, 4095]; Format:7.5;Directional sharpen strength for edge enhancement */
    GK_U16 u16TextureFreq;         /* RW; range: [0, 4095];Format:6.6; Texture frequency adjustment. Texture and detail will be finer when it increase */
    GK_U16 u16EdgeFreq;            /* RW; range: [0, 4095];Format:6.6; Edge frequency adjustment. Edge will be narrower and thiner when it increase */
    GK_U8  u8OverShoot;            /* RW; range: [0, 127]; Format:7.0;u8OvershootAmt */
    GK_U8  u8UnderShoot;           /* RW; range: [0, 127]; Format:7.0;u8UndershootAmt */
    GK_U8  u8ShootSupStr;          /* RW; range: [0, 255]; Format:8.0;overshoot and undershoot suppression strength, the amplitude and width of shoot will be decrease when shootSupSt increase */

    GK_U8   u8NrLscRatio;                       /* RW;Range:[0x0,0xff];Format:8.0; Strength of reserving the random noise according to luma,GK7205V200/GK7205V300/GK7202V300/GK7605V100 not support */
    GK_U16  au16CoarseStr[ISP_BAYER_CHN_NUM];   /* RW;Range:[0x0,0x3ff];Format:10.0; Coarse Strength of noise reduction */
    GK_U8   au8WDRFrameStr[WDR_MAX_FRAME_NUM];  /* RW;Range:[0x0,0x50];Format:7.0; Coarse strength of each frame in wdr mode */
    GK_U8   au8ChromaStr[ISP_BAYER_CHN_NUM];    /* RW;Range:[0x0,0x3];Format:2.0;Strength of Chrmoa noise reduction for R/Gr/Gb/B channel, V100/ V200/ V300
                                                 GK7205V200/GK7205V300/GK7202V300/GK7605V100 not support */
    GK_U8   u8FineStr;              /* RW;Range:[0x0,0x80];Format:8.0;Strength of Luma noise reduction */
    GK_U16  u16CoringWgt;           /* RW;Range:[0x0,0xC80];Format:12.0;Strength of reserving the random noise */

    GK_U16 u16DeHazeStrengthActual; /* RW;Range:[0,0xFF];Format:8.0;actual dehze strength */
    GK_U16 u16DrcStrengthActual;    /* RW;Range: GK7608V200 = [0x0, 0xFF] | GK7606V100 = [0x0, 0x3FF] |  V100 = [0x0, 0x3FF]|  V200 = [0x0, 0x3FF]|
                                                                 V300 = [0x0, 0x3FF]|
                                                                GK7205V200 = [0x0, 0x3FF]|GK7205V300 = [0x0, 0x3FF]|GK7202V300 = [0x0, 0x3FF]|GK7605V100 = [0x0, 0x3FF] ;Strength of dynamic range compression.
                                                                Higher values lead to higher differential gain between shadows and highlights. */
    GK_U32 u32WDRExpRatioActual[3]; /* RW; Range:[0x40, 0x4000]; Format:26.6; 0x40 means 1 times.
                                                                 When enExpRatioType is OP_TYPE_AUTO, u32ExpRatio is invalid.
                                                                 When enExpRatioType is OP_TYPE_MANUAL, u32ExpRatio is quotient of long exposure time / short exposure time. */
    GK_BOOL bWDRSwitchFinish;       /* RW; Range:[0, 1];Format:1.0;GK_TRUE: WDR switch is finished */
    GK_BOOL bResSwitchFinish;       /* RW; Range:[0, 1];Format:1.0;GK_TRUE: Resolution switch is finished */
    GK_U16 au16BLActual[ISP_BAYER_CHN_NUM]; /* RW; Range: [0x0, 0xFFF];Format:12.0;Actual Black level values that correspond to the black levels of the R,Gr, Gb, and B components respectively. */
} ISP_INNER_STATE_INFO_S;

/*
The position of AE histogram in ISP BE pipeline
0 = After DG;
1 = After static WB;
2 = After DRC;
*/
typedef enum ISP_AE_SWITCH_E {
    ISP_AE_AFTER_DG = 0,
    ISP_AE_AFTER_WB,
    ISP_AE_AFTER_DRC,
    ISP_AE_SWITCH_BUTT
} ISP_AE_SWITCH_E;

/*
FourPlaneMode enable
0 : Disabled;
1 : Enabled
*/
typedef enum ISP_AE_FOUR_PLANE_MODE_E {
    ISP_AE_FOUR_PLANE_MODE_DISABLE = 0,
    ISP_AE_FOUR_PLANE_MODE_ENABLE,
    ISP_AE_FOUR_PLANE_MODE_BUTT
} ISP_AE_FOUR_PLANE_MODE_E;

typedef enum ISP_AE_HIST_SKIP_E {
    ISP_AE_HIST_SKIP_EVERY_PIXEL = 0,
    ISP_AE_HIST_SKIP_EVERY_2ND_PIXEL,
    ISP_AE_HIST_SKIP_EVERY_3RD_PIXEL,
    ISP_AE_HIST_SKIP_EVERY_4TH_PIXEL,
    ISP_AE_HIST_SKIP_EVERY_5TH_PIXEL,
    ISP_AE_HIST_SKIP_EVERY_8TH_PIXEL,
    ISP_AE_HIST_SKIP_EVERY_9TH_PIXEL,
    ISP_AE_HIST_SKIP_BUTT
} ISP_AE_HIST_SKIP_E;

typedef enum ISP_AE_HIST_OFFSET_X_E {
    ISP_AE_HIST_START_FORM_FIRST_COLUMN = 0,
    ISP_AE_HIST_START_FORM_SECOND_COLUMN,
    ISP_AE_HIST_OFFSET_X_BUTT
} ISP_AE_HIST_OFFSET_X_E;

typedef enum ISP_AE_HIST_OFFSET_Y_E {
    ISP_AE_HIST_START_FORM_FIRST_ROW = 0,
    ISP_AE_HIST_START_FORM_SECOND_ROW,
    ISP_AE_HIST_OFFSET_Y_BUTT
} ISP_AE_HIST_OFFSET_Y_E;

/* Defines the mode configuration for the sampling points during global histogram statistics. */
typedef struct ISP_AE_HIST_CONFIG_S {
    ISP_AE_HIST_SKIP_E enHistSkipX;    /* RW; Range:[0,6]; Format:4.0;
                                                                    Histogram decimation in horizontal direction: 0=every pixel; 1=every 2nd pixel; 2=every
                                                                    3rd pixel; 3=every 4th pixel; 4=every 5th pixel; 5=every 8th pixel ; 6+=every 9th pixel */
    ISP_AE_HIST_SKIP_E enHistSkipY;    /* RW; Range:[0,6]; Format:4.0;
                                                                    Histogram decimation in vertical direction: 0=every pixel; 1=every 2nd pixel; 2=every
                                                                    3rd pixel; 3=every 4th pixel; 4=every 5th pixel; 5=every 8th pixel ; 6+=every 9th pixel */
    ISP_AE_HIST_OFFSET_X_E enHistOffsetX;  /* RW; Range:[0,1]; Format:1.0; 0= start from the first column; 1=start from second column */
    ISP_AE_HIST_OFFSET_Y_E enHistOffsetY;  /* RW; Range:[0,1]; Format:1.0; 0= start from the first row; 1= start from second row */
} ISP_AE_HIST_CONFIG_S;

typedef enum ISP_AE_STAT_MODE__E {
    ISP_AE_NORMAL = 0,
    ISP_AE_ROOT,
    ISP_AE_MODE_BUTT
} ISP_AE_STAT_MODE_E;

/* Crops the input image of the AE module */
typedef struct ISP_AE_CROP_S {
    GK_BOOL bEnable; /* RW; Range: [0,1];  Format:1.0;AE crop enable. */
    GK_U16  u16X;    /* RW; Range: GK7608V200 = [0, 8192 - 256]|GK7606V100 = [0, 8192 - 256]| V100 = [0, 4608 - 256]| V200 = [0, 4608 - 256]|
                                        V300 = [0, 4608 - 256]|
                                       GK7205V200 = [0,3072 - 256]|GK7205V300 = [0,3072 - 256]|GK7202V300 = [0,3072 - 256]|GK7605V100 = [0,3072 - 256];
                                       Format:13.0;AE image crop start x, limited range:[0, ImageWidth - 256] */
    GK_U16  u16Y;   /* RW; Range: GK7608V200 = [0, 8192 - 120]|GK7606V100 = [0, 8192 - 120]| V100 = [0, 4608 - 120]| V200 = [0, 4608 - 120]|
                                       V300 = [0, 4608 - 120]|
                                      GK7205V200 = [0,3072 - 120]|GK7205V300 = [0,3072 - 120]|GK7202V300 = [0,3072 - 120]| GK7605V100 = [0,3072 - 120];
                                      Format:13.0;AEimage crop start y, limited range:[0, ImageHeight - 120]  */
    GK_U16  u16W;   /* RW; Range: GK7608V200 = [256, 8192]|GK7606V100 = [256, 8192]| V100 = [256, 4608]| V200 = [256, 4608] |
                                      V300 = [256, 4608] |
                                     GK7205V200 = [256, 3072]|GK7205V300 = [256, 3072]|GK7202V300 = [256, 3072]|GK7605V100 = [256, 3072];
                                     Format:14.0;AE image crop width,  limited range:[256, ImageWidth] */
    GK_U16  u16H;  /* RW; Range: GK7608V200 = [120, 8192]|GK7606V100 = [120, 8192]| V100 = [120, 4608]| V200 = [120, 4608] |
                                     V300 = [120, 4608] |
                                    GK7205V200 = [120, 3072]|GK7205V300 = [120, 3072]|GK7202V300 = [120, 3072]|GK7605V100 = [120, 3072];
                                    Format:14.0;AE image crop height  limited range:[120, ImageHeight] */
} ISP_AE_CROP_S;

/* config of statistics structs */
#define HIST_THRESH_NUM                           (4)
typedef struct ISP_AE_STATISTICS_CFG_S {
    ISP_AE_SWITCH_E          enAESwitch;          /* RW; Range:[0,2]; Format:2.0;The position of AE histogram in ISP BE pipeline */
    ISP_AE_HIST_CONFIG_S     stHistConfig;
    ISP_AE_FOUR_PLANE_MODE_E enFourPlaneMode;     /* RW; Range:[0,1]; Format:2.0;Four Plane Mode Enable */
    ISP_AE_STAT_MODE_E       enHistMode;          /* RW; Range:[0,1]; Format:2.0;AE Hist Rooting Mode */
    ISP_AE_STAT_MODE_E       enAverMode;          /* RW; Range:[0,1]; Format:2.0;AE Aver Rooting Mode */
    ISP_AE_STAT_MODE_E       enMaxGainMode;       /* RW; Range:[0,1]; Format:2.0;Max Gain Rooting Mode */
    ISP_AE_CROP_S            stCrop;
    GK_U8 au8Weight[AE_ZONE_ROW][AE_ZONE_COLUMN]; /* RW; Range:[0x0, 0xF]; Format:4.0; AE weighting table */
} ISP_AE_STATISTICS_CFG_S;

// Smart Info
#define SMART_CLASS_MAX                           (2)

/* Only used for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
typedef struct ISP_SMART_ROI_S {
    GK_BOOL  bEnable;
    GK_BOOL  bAvailable;
    GK_U8    u8Luma ;
} ISP_SMART_ROI_S;

/* Only used for GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
typedef struct ISP_SMART_INFO_S {
    ISP_SMART_ROI_S  stROI[SMART_CLASS_MAX];
} ISP_SMART_INFO_S;

/* fines whether the peak value of the zoned IIR statistics is calculated.  */
typedef enum ISP_AF_PEAK_MODE_E {
    ISP_AF_STA_NORM         = 0,    /* use every value of the block statistic */
    ISP_AF_STA_PEAK,                /* use the maximum value in one line of the block statistic */
    ISP_AF_STA_BUTT
} ISP_AF_PEAK_MODE_E;

/* Defines whether the zoned statistics are squared in square mode.  */
typedef enum ISP_AF_SQU_MODE_E {
    ISP_AF_STA_SUM_NORM     = 0,    /* statistic value accumlate */
    ISP_AF_STA_SUM_SQU,             /* statistic value square then accumlate */
    ISP_AF_STA_SUM_BUTT
} ISP_AF_SQU_MODE_E;
/* Crops the input image of the AF module.  */
typedef struct ISP_AF_CROP_S {
    GK_BOOL bEnable; /* RW; Range: [0,1];  Format:1.0; AF crop enable */
    GK_U16  u16X;    /* RW; Range: GK7608V200 = [0, 7936]|GK7606V100 = [0, 7936]| V100 = [0, 4352]| V200 = [0, 4352]|
                                        V300 = [0, 4352]|GK7205V200 = [0, 2816]|GK7205V300 = [0, 2816]|GK7202V300 = [0, 2816]|GK7605V100 = [0, 2816];
                                       Format:13.0;AF image crop start x, limited range:[0, ImageWidth-256] */
    GK_U16  u16Y;    /* RW; Range: GK7608V200 = [0, 8072]|GK7606V100 = [0, 8072]| V100 = [0, 4488]| V200 = [0, 4488]|
                                        V300 = [0, 4488]|GK7205V200 = [0, 2952]|GK7205V300 = [0,2952]|GK7202V300 = [0,2952]|GK7605V100 = [0,2952];
                                       Format:13.0;AF image crop start y, limited range:[0, ImageHeight-120] */
    GK_U16  u16W;    /* RW; Range: GK7608V200 = [256, 8192]|GK7606V100 = [256, 8192]| V100 = [256, 4608]| V200 = [256, 4608]|
                                        V300 = [256, 4608]|GK7205V200 = [256, 3072]|GK7205V300 = [256, 3072]|GK7202V300 = [256, 3072]|GK7605V100 = [256, 3072];
                                       Format:14.0;AF image crop width, limited range:[256, ImageWidth] */
    GK_U16  u16H;    /* RW; Range: GK7608V200 = [120, 8192]|GK7606V100 = [120, 8192]| V100 = [120, 4608]| V200 = [120, 4608]|
                                        V300 = [120, 4608]|GK7205V200 = [120,3072]|GK7205V300 = [120,3072]|GK7202V300 = [120, 3072]|GK7605V100 = [120, 3072];
                                       Format:14.0;AF image crop height, limited range:[120, ImageHeight] */
} ISP_AF_CROP_S;

/* Defines the position of AF module statistics.  */
typedef enum ISP_AF_STATISTICS_POS_E {
    ISP_AF_STATISTICS_AFTER_DGAIN    = 0, // The AF module is placed in the raw field for statistics,AF after DGain
    ISP_AF_STATISTICS_AFTER_DRC,         // The AF module is placed in the raw field for statistics,AF after DRC
    ISP_AF_STATISTICS_AFTER_CSC,         // The AF module is placed in the YUV field for statistics,AF after CSC
    ISP_AF_STATISTICS_BUTT
} ISP_AF_STATISTICS_POS_E;

/* Configures the Bayer field of the AF module.  */
typedef struct ISP_AF_RAW_CFG_S {
    GK_U8               GammaGainLimit; /* RW; Range: [0x0, 0x5]; Format:3.0,Not support GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U8               GammaValue;     /* RW; Range: GK7608V200 = [0x0, 0x6] | GK7606V100 = [0x0, 0x6] |  V100 = [0x0, 0x6] |  V200 = [0x0, 0x6]|
                                                                        V300 = [0x0, 0x6]|GK7205V200 = [0x0, 0x1]|GK7205V300 = [0x0, 0x1]|GK7202V300 = [0x0, 0x1]|GK7605V100 = [0x0, 0x1]; */
    ISP_BAYER_FORMAT_E  enPattern;      /* RW; Range: [0x0, 0x3]; Format:2.0;raw domain pattern */
} ISP_AF_RAW_CFG_S;
/* Configures the pre-filter of the AF module.  */
typedef struct ISP_AF_PRE_FILTER_CFG_S {
    GK_BOOL             bEn;         /* RW; Range: [0,1]; Format:1.0; pre filter enable  .          */
    GK_U16              u16strength; /* RW; Range: [0x0, 0xFFFF]; Format:16.0;pre filter strength    */
} ISP_AF_PRE_FILTER_CFG_S;

/* Defines AF statistics configuration parameters.  */
typedef struct ISP_AF_CFG_S {
    GK_BOOL                 bEnable;        /* RW; Range: [0,1];   AF enable. */
    GK_U16                  u16Hwnd;        /* RW; Range: [1, 17]; AF statistic window horizontal block.  */
    GK_U16                  u16Vwnd;        /* RW; Range: [1, 15]; AF statistic window veritical block.  */
    GK_U16                  u16Hsize;       /* RW; Range: GK7608V200 = [256, 8192]|GK7606V100 = [256, 8192]| V100 = [256, 4608]| V200 = [256, 4608]|
                                                                               V300 = [256, 4608]|GK7205V200 = [256,3072]|GK7205V300 = [256,3072]|GK7202V300 = [256,3072]|GK7605V100 = [256,3072];
                                                                              limited Range: [256, ImageWidth],AF image width. */
    GK_U16                  u16Vsize;       /* RW; Range: GK7608V200 = [120, 8192]|GK7606V100 = [120, 8192]| V100 = [120, 4608]| V200 = [120, 4608]|
                                                                               V300 = [120, 4608]|GK7205V200 = [120,3072]|GK7205V300 = [120,3072]|GK7202V300 = [120,3072]|GK7605V100 = [120,3072];
                                                                              limited Range: [120, ImageHeight],AF image height. */
    ISP_AF_PEAK_MODE_E      enPeakMode;     /* RW; Range: [0,1]; AF peak value statistic mode. */
    ISP_AF_SQU_MODE_E       enSquMode;      /* RW; Range: [0,1]; AF statistic square accumulate. */
    ISP_AF_CROP_S           stCrop;         /* RW; AF input image crop */
    ISP_AF_STATISTICS_POS_E enStatisticsPos; /* RW; Range: [0,2]; AF statistic position, it can be set to yuv or raw */
    ISP_AF_RAW_CFG_S        stRawCfg;       /* RW; When AF locate at RAW domain, these para should be cfg. */
    ISP_AF_PRE_FILTER_CFG_S stPreFltCfg;    /* RW; pre filter cfg */
    GK_U16                  u16HighLumaTh;  /* RW; Range: [0,0xFF]; high luma threshold. */
} ISP_AF_CFG_S;
/* Configures the AF level depend gain module.  */
typedef struct ISP_AF_LD_S {
    GK_BOOL     bLdEn;                      /* RW; Range: [0, 1]; FILTER level depend gain enable. */
    GK_U16      u16ThLow;                   /* RW; range: [0x0, 0xFF]; FILTER level depend th low */
    GK_U16      u16GainLow;                 /* RW; range: [0x0, 0xFF]; FILTER level depend gain low */
    GK_U16      u16SlpLow;                  /* RW; range: [0x0, 0xF];  FILTER level depend slope low */
    GK_U16      u16ThHigh;                  /* RW; range: [0x0, 0xFF]; FILTER level depend th high */
    GK_U16      u16GainHigh;                /* RW; range: [0x0, 0xFF]; FILTER level depend gain high */
    GK_U16      u16SlpHigh;                 /* RW; range: [0x0, 0xF];  FILTER level depend slope high */
} ISP_AF_LD_S;
/* Configures the AF coring module.  */
typedef struct ISP_AF_CORING_S {
    GK_U16      u16Th;                      /* RW; Range: [0x0, 0x7FF];FILTER coring threshold. */
    GK_U16      u16Slp;                     /* RW; Range: [0x0, 0xF];  FILTER Coring Slope */
    GK_U16      u16Lmt;                     /* RW; Range: [0x0, 0x7FF];FILTER coring limit */
} ISP_AF_CORING_S ;


#define IIR_EN_NUM                                (3)
#define IIR_GAIN_NUM                              (7)
#define IIR_SHIFT_NUM                             (4)
/* Defines the IIR parameter configuration of horizontal filters for AF statistics.  */
typedef struct ISP_AF_H_PARAM_S {
    GK_BOOL         bNarrowBand;                /* RW; Range: [0, 1]; IIR narrow band enable. */
    GK_BOOL         abIIREn[IIR_EN_NUM];        /* RW; Range: [0, 1]; IIR enable. */
    GK_U8           u8IIRShift;                 /* RW; Range: [0, 63]; IIR Shift. Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_S16          as16IIRGain[IIR_GAIN_NUM];  /* RW; Range: [-511, 511]. IIR gain,gain0 range:[0,255]. */
    GK_U16          au16IIRShift[IIR_SHIFT_NUM]; /* RW; Range: [0x0, 0x7];  IIR shift. */
    ISP_AF_LD_S     stLd;                       /* RW; filter level depend. */
    ISP_AF_CORING_S stCoring;                   /* RW; filter coring. */
} ISP_AF_H_PARAM_S;

#define FIR_GAIN_NUM                              (5)

/*  */
typedef struct ISP_AF_V_PARAM_S {
    GK_S16          as16FIRH[FIR_GAIN_NUM]; /* RW; Range: [-31, 31];   FIR gain. */
    ISP_AF_LD_S     stLd;                   /* RW; filter level depend. */
    ISP_AF_CORING_S stCoring;               /* RW; filter coring.  */
} ISP_AF_V_PARAM_S;

#define ACC_SHIFT_H_NUM                           (2)
#define ACC_SHIFT_V_NUM                           (2)

/*  */
typedef struct ISP_AF_FV_PARAM_S {
    GK_U16 u16AccShiftY;                    /* RW; Range: [0x0, 0xF]; luminance Y statistic shift. */
    GK_U16 au16AccShiftH[ACC_SHIFT_H_NUM];  /* RW; Range: [0x0, 0xF]; IIR statistic shift. */
    GK_U16 au16AccShiftV[ACC_SHIFT_V_NUM];  /* RW; Range: [0x0, 0xF]; FIR statistic shift. */
    GK_U16 u16HlCntShift;                   /* RW; Range: [0x0, 0xF]; High luminance counter shift */
} ISP_AF_FV_PARAM_S;

/*  */
typedef struct ISP_FOCUS_STATISTICS_CFG_S {
    ISP_AF_CFG_S        stConfig;
    ISP_AF_H_PARAM_S    stHParam_IIR0;
    ISP_AF_H_PARAM_S    stHParam_IIR1;
    ISP_AF_V_PARAM_S    stVParam_FIR0;
    ISP_AF_V_PARAM_S    stVParam_FIR1;
    ISP_AF_FV_PARAM_S   stFVParam;
} ISP_FOCUS_STATISTICS_CFG_S;

/*
   the main purpose of stat key was to access individual statistic info separately...
   ...for achieving performance optimization of CPU, because of we acquire stat...
   ... in ISP_DRV ISR for our firmware reference and USER can also use alternative MPI...
   ... to do this job, so bit1AeStat1~bit1AfStat for MPI behavior control, and bit16IsrAccess...
   ... for ISR access control, they were independent. but they have the same bit order, for example...
   ... bit1AeStat1 for MPI AeStat1 access key, and bit16 of u32Key for ISR AeStat1 access key
*/
typedef union ISP_STATISTICS_CTRL_U {
    GK_U64  u64Key;
    struct {
        GK_U64  bit1FEAeGloStat     : 1 ;   /* [0] */
        GK_U64  bit1FEAeLocStat     : 1 ;   /* [1] */
        GK_U64  bit1FEAeStiGloStat  : 1 ;   /* [2] .Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
        GK_U64  bit1FEAeStiLocStat  : 1 ;   /* [3] .Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
        GK_U64  bit1BEAeGloStat     : 1 ;   /* [4] */
        GK_U64  bit1BEAeLocStat     : 1 ;   /* [5] */
        GK_U64  bit1BEAeStiGloStat  : 1 ;   /* [6] .Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
        GK_U64  bit1BEAeStiLocStat  : 1 ;   /* [7] .Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
        GK_U64  bit1AwbStat1        : 1 ;   /* [8] */
        GK_U64  bit1AwbStat2        : 1 ;   /* [9] */
        GK_U64  bit2Rsv0            : 2 ;   /* [10:11] */
        GK_U64  bit1FEAfStat        : 1 ;   /* [12] .Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
        GK_U64  bit1BEAfStat        : 1 ;   /* [13] . */
        GK_U64  bit2Rsv1            : 2 ;   /* [14:15] */
        GK_U64  bit1Dehaze          : 1 ;   /* [16] */
        GK_U64  bit1MgStat          : 1 ;   /* [17] */
        GK_U64  bit14Rsv            : 14;   /* [18:31] */
        GK_U64  bit32IsrAccess      : 32;   /* [32:63] */
    };
} ISP_STATISTICS_CTRL_U;


/* statistics structs */
#define HIST_NUM                                  (1024)
#define BAYER_PATTERN_NUM                         (4)
#define WDR_CHN_MAX                               (4)
#define ISP_CHN_MAX_NUM                           (4)

typedef struct ISP_AE_GRID_INFO_S {
    GK_U16 au16GridYPos[AE_ZONE_ROW + 1];   /* R */
    GK_U16 au16GridXPos[AE_ZONE_COLUMN + 1]; /* R */
    GK_U8  u8Status;                        /* R;0:not update, 1: update,others:reserved */
} ISP_AE_GRID_INFO_S;

typedef struct ISP_MG_GRID_INFO_S {
    GK_U16 au16GridYPos[MG_ZONE_ROW + 1];    /* R */
    GK_U16 au16GridXPos[MG_ZONE_COLUMN + 1]; /* R */
    GK_U8  u8Status;                         /* R;0:not update, 1: update,others:reserved */
} ISP_MG_GRID_INFO_S;

typedef struct ISP_AWB_GRID_INFO_S {
    GK_U16 au16GridYPos[AWB_ZONE_ORIG_ROW  + 1];   /* R */
    GK_U16 au16GridXPos[AWB_ZONE_ORIG_COLUMN + 1]; /* R */
    GK_U8  u8Status;                               /* R;0:not update, 1: update,others:reserved */
} ISP_AWB_GRID_INFO_S;

typedef struct ISP_FOCUS_GRID_INFO_S {
    GK_U16 au16GridYPos[AF_ZONE_ROW + 1];    /* R */
    GK_U16 au16GridXPos[AF_ZONE_COLUMN + 1]; /* R */
    GK_U8  u8Status;                         /* R;0:not update, 1: update,others:reserved */
} ISP_FOCUS_GRID_INFO_S;


typedef struct ISP_AE_STATISTICS_S {
    GK_U32 au32FEHist1024Value[ISP_CHN_MAX_NUM][HIST_NUM];                                 /* R; Range: [0x0, 0xFFFFFFFF]; Format:32.0; Global 1024 bins histogram of FE */
    GK_U16 au16FEGlobalAvg[ISP_CHN_MAX_NUM][BAYER_PATTERN_NUM];                            /* R; Range: [0x0, 0xFFFF]; Format:16.0; Global average value of FE,Not support GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16 au16FEZoneAvg[ISP_CHN_MAX_NUM][AE_ZONE_ROW][AE_ZONE_COLUMN][BAYER_PATTERN_NUM]; /* R; Range: [0x0, 0xFFFF]; Format:16.0; Zone average value of FE, Not support for  V100/ V200/ V300's Fe1 and Fe3,
                                                                                                                                                           Not support GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U32 au32BEHist1024Value[HIST_NUM];                                                  /* R; Range: [0x0, 0xFFFFFFFF]; Format:32.0; Global 1024 bins histogram of BE */
    GK_U16 au16BEGlobalAvg[BAYER_PATTERN_NUM];                                             /* R; Range: [0x0, 0xFFFF]; Format:16.0; Global average value of BE */
    GK_U16 au16BEZoneAvg[AE_ZONE_ROW][AE_ZONE_COLUMN][BAYER_PATTERN_NUM];                  /* R; Range: [0x0, 0xFFFF]; Format:16.0; Zone average value of BE */
    ISP_AE_GRID_INFO_S stFEGridInfo;
    ISP_AE_GRID_INFO_S stBEGridInfo;
} ISP_AE_STATISTICS_S;

/* Not support for  V100/ V200/ V300 */
typedef struct ISP_AE_STITCH_STATISTICS_S {
    GK_U32 au32FEHist1024Value[ISP_CHN_MAX_NUM][HIST_NUM];                                                  /* R; Range: [0x0, 0xFFFFFFFF]; Format:32.0; Global 1024 bins histogram of FE.Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16 au16FEGlobalAvg[ISP_CHN_MAX_NUM][BAYER_PATTERN_NUM];                                             /* R; Range: [0x0, 0xFFFF]; Format:16.0; Global average value of FE.Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16 au16FEZoneAvg[VI_MAX_PIPE_NUM][ISP_CHN_MAX_NUM][AE_ZONE_ROW][AE_ZONE_COLUMN][BAYER_PATTERN_NUM]; /* R; Range: [0x0, 0xFFFF]; Format:16.0; Zone average value of FE.Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U32 au32BEHist1024Value[HIST_NUM];                                                                   /* R; Range: [0x0, 0xFFFFFFFF]; Format:32.0; Global 1024 bins histogram of BE.Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16 au16BEGlobalAvg[BAYER_PATTERN_NUM];                                                              /* R; Range: [0x0, 0xFFFF]; Format:16.0; Global average value of BE.Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    GK_U16 au16BEZoneAvg[VI_MAX_PIPE_NUM][AE_ZONE_ROW][AE_ZONE_COLUMN][BAYER_PATTERN_NUM];                  /* R; Range: [0x0, 0xFFFF]; Format:16.0; Zone average value of BE.Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
} ISP_AE_STITCH_STATISTICS_S;

typedef struct ISP_MG_STATISTICS_S {
    GK_U16 au16ZoneAvg[MG_ZONE_ROW][MG_ZONE_COLUMN][BAYER_PATTERN_NUM];         /* R; Range: [0x0, 0xFF]; Format:8.0; Zone average value */
    ISP_MG_GRID_INFO_S stGridInfo;
} ISP_MG_STATISTICS_S;


/************ AWB*************/

typedef enum ISP_AWB_SWITCH_E {
    ISP_AWB_AFTER_DG                   = 0,
    ISP_AWB_AFTER_Expander,
    ISP_AWB_AFTER_DRC,
    ISP_AWB_SWITCH_BUTT
} ISP_AWB_SWITCH_E;

/* Crops the input image of the AWB module */
typedef struct ISP_AWB_CROP_S {
    GK_BOOL bEnable;  /* RW; Range: [0,1];  Format:1.0;AWB crop enable */
    GK_U16  u16X;     /* RW; Range: GK7608V200 = [0, 8192 - 60]|GK7606V100 = [0, 8192 - 60]| V100 = [0, 4608 - 60]| V200 = [0, 4608 - 60]|
                                          V300 = [0, 4608 - 60]|
                                         GK7205V200 = [0,3072- 60]|GK7205V300 = [0,3072- 60]|GK7202V300 = [0,3072- 60]|GK7605V100 = [0,3072- 60];
                                         Format:13.0;AWB image crop start x, limited range:[0, ImageWidth - u16ZoneCol * 60] */
    GK_U16  u16Y;     /* RW; Range: GK7608V200 = [0, 8192 - 14]|GK7606V100 = [0, 8192 - 14]| V100 = [0, 4608 - 14]| V200 = [0, 4608 - 14]|
                                          V300 = [0, 4608 - 14]|
                                         GK7205V200 = [0,3072-14]|GK7205V300 = [0,3072-14]|GK7202V300 = [0,3072-14]|GK7605V100 = [0,3072-14];
                                         Format:13.0;AWB image crop start y,limited range:[0, ImageHeight - u16ZoneRow * 14] */
    GK_U16  u16W;     /* RW; Range: GK7608V200 = [60, 8192]|GK7606V100 = [60, 8192]| V100 = [60, 4608]| V200 = [60, 4608] |
                                          V300 = [60, 4608] |
                                         GK7205V200 = [60,3072]|GK7205V300 = [60,3072]|GK7202V300 = [60,3072]|GK7605V100 = [60,3072];
                                         Format:14.0;AWB image crop width, limited range:[u16ZoneCol * 60, ImageWidth] */
    GK_U16  u16H;     /* RW; Range: GK7608V200 = [14, 8192]|GK7606V100 = [14, 8192]| V100 = [14, 4608]| V200 = [14, 4608] |
                                          V300 = [14, 4608] |
                                         GK7205V200 = [14,3072]|GK7205V300 = [14,3072]|GK7202V300 = [14,3072]|GK7605V100 = [14,3072];
                                         Format:14.0;AWB image crop height, limited range:[u16ZoneRow * 14, ImageHeight] */
} ISP_AWB_CROP_S;

/* Defines the AWB statistics configuration */
typedef struct ISP_WB_STATISTICS_CFG_S {
    ISP_AWB_SWITCH_E enAWBSwitch; /* RW; Range: [0x0, 0x2]; Position of AWB statistics in pipeline */
    GK_U16 u16ZoneRow;            /* RW; Range: [0x1, 0x20]; Vertical Blocks, limited range:[1, min(32, ImageHeight /AWB_MIN_HEIGHT)] */
    GK_U16 u16ZoneCol;            /* RW; Range: [0x1, 0x20]; Horizontal Blocks, limited range:[BlkNum, min(32, Width /AWB_MIN_WIDTH)] */
    GK_U16 u16ZoneBin;            /* RW; Range:GK7608V200 = [1, 4] | GK7606V100 = [1, 4] |  V100 = [1, 1]| V200 = [1, 1]|
                                                          V300 = [1, 1]|
                                                         GK7205V200 = [1,1]|GK7205V300 = [1,1]|GK7202V300 = [1,1]|GK7605V100 = [1,1]; Brightness Bins */
    GK_U16 au16HistBinThresh[4]; /* RW; Range: [0x0, 0xFFFF]; Bin Threshold */
    GK_U16 u16WhiteLevel;        /* RW; Range: [0x0, 0xFFFF];Upper limit of valid data for white region,  for Bayer statistics, [0x0, 0x3FF] for RGB statistics */
    GK_U16 u16BlackLevel;        /* RW; Range: [0x0, 0xFFFF];limited range: [0x0, u16WhiteLevel],Lower limit of valid data for white region . for Bayer statistics, bitwidth is 12, for RGB statistics, bitwidth is 10 */
    GK_U16 u16CbMax;             /* RW; Range: [0x0, 0xFFF];Maximum value of B/G for white region */
    GK_U16 u16CbMin;             /* RW; Range: [0x0, 0xFFF];limited range: [0x0, u16CbMax]Minimum value of B/G for white region */
    GK_U16 u16CrMax;             /* RW; Range: [0x0, 0xFFF];Maximum value of R/G for white region */
    GK_U16 u16CrMin;             /* RW; Range: [0x0, 0xFFF];limited range: [0x0, u16CrMax],Minimum value of R/G for white region */
    ISP_AWB_CROP_S stCrop;
} ISP_WB_STATISTICS_CFG_S;

typedef struct ISP_WB_STITCH_STATISTICS_S {
    GK_U16  u16ZoneRow;                                 /* R; Range: [0x0, 0x20]; effective horizontal block number for AWB statistic stitch window */
    GK_U16  u16ZoneCol;                                 /* R; Range: [0x0, 0x80]; effective vetical block number for AWB statistic stitch window */
    GK_U16  au16ZoneAvgR[AWB_ZONE_STITCH_MAX];          /* R; Range: [0x0, 0xFFFF];Zone Average R  for Stitich mode */
    GK_U16  au16ZoneAvgG[AWB_ZONE_STITCH_MAX];          /* R; Range: [0x0, 0xFFFF];Zone Average G  for Stitich mode */
    GK_U16  au16ZoneAvgB[AWB_ZONE_STITCH_MAX];          /* R; Range: [0x0, 0xFFFF];Zone Average B  for Stitich mode */
    GK_U16  au16ZoneCountAll[AWB_ZONE_STITCH_MAX];      /* R; Range: [0x0, 0xFFFF];normalized number of Gray points  for Stitich mode */
} ISP_WB_STITCH_STATISTICS_S;

typedef struct ISP_WB_STATISTICS_S {
    GK_U16 u16GlobalR;          /* R; Range: [0x0, 0xFFFF];Global WB output Average R */
    GK_U16 u16GlobalG;          /* R; Range: [0x0, 0xFFFF];Global WB output Average G */
    GK_U16 u16GlobalB;          /* R; Range: [0x0, 0xFFFF];Global WB output Average B */
    GK_U16 u16CountAll;         /* R; Range: [0x0, 0xFFFF];normalized number of Gray points */

    GK_U16 au16ZoneAvgR[AWB_ZONE_NUM];            /* R; Range: [0x0, 0xFFFF];Zone Average R */
    GK_U16 au16ZoneAvgG[AWB_ZONE_NUM];            /* R; Range: [0x0, 0xFFFF];Zone Average G */
    GK_U16 au16ZoneAvgB[AWB_ZONE_NUM];            /* R; Range: [0x0, 0xFFFF];Zone Average B */
    GK_U16 au16ZoneCountAll[AWB_ZONE_NUM];        /* R; Range: [0x0, 0xFFFF];normalized number of Gray points */
    ISP_AWB_GRID_INFO_S stGridInfo;
} ISP_WB_STATISTICS_S;

typedef struct ISP_FOCUS_ZONE_S {
    GK_U16  u16v1;             /* R; Range: [0x0, 0xFFFF];vertical fir block1 Statistics */
    GK_U16  u16h1;             /* R; Range: [0x0, 0xFFFF];horizontal iir block1 Statistics */
    GK_U16  u16v2;             /* R; Range: [0x0, 0xFFFF];vertical fir block2 Statistics */
    GK_U16  u16h2;             /* R; Range: [0x0, 0xFFFF];horizontal iir block2 Statistics */
    GK_U16  u16y;              /* R; Range: [0x0, 0xFFFF];Y Statistics */
    GK_U16  u16HlCnt;          /* R; Range: [0x0, 0xFFFF];HlCnt Statistics */
} ISP_FOCUS_ZONE_S;

typedef struct ISP_FE_FOCUS_STATISTICS_S {
    ISP_FOCUS_ZONE_S stZoneMetrics[WDR_CHN_MAX][AF_ZONE_ROW][AF_ZONE_COLUMN]; /* R; The zoned measure of contrast */
} ISP_FE_FOCUS_STATISTICS_S;

typedef struct ISP_BE_FOCUS_STATISTICS_S {
    ISP_FOCUS_ZONE_S stZoneMetrics[AF_ZONE_ROW][AF_ZONE_COLUMN]; /* R; The zoned measure of contrast */
} ISP_BE_FOCUS_STATISTICS_S;

typedef struct ISP_AF_STATISTICS_S {
    ISP_FE_FOCUS_STATISTICS_S      stFEAFStat; /* Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    ISP_BE_FOCUS_STATISTICS_S      stBEAFStat; /*  */
    ISP_FOCUS_GRID_INFO_S          stFEAFGridInfo; /* Not support for  V100/ V200/ V300/GK7205V200/GK7205V300/GK7202V300/GK7605V100 */
    ISP_FOCUS_GRID_INFO_S          stBEAFGridInfo; /*  */
} ISP_AF_STATISTICS_S;


typedef struct ISP_STATISTICS_CFG_S {
    ISP_STATISTICS_CTRL_U       unKey;
    ISP_AE_STATISTICS_CFG_S     stAECfg;
    ISP_WB_STATISTICS_CFG_S     stWBCfg;
    ISP_FOCUS_STATISTICS_CFG_S  stFocusCfg; /*  */
} ISP_STATISTICS_CFG_S;

typedef struct ISP_INIT_ATTR_S {
    GK_BOOL bIsIrMode;
    GK_U32 u32ExpTime;
    GK_U32 u32AGain;
    GK_U32 u32DGain;
    GK_U32 u32ISPDGain;
    GK_U32 u32Exposure;
    GK_U32 u32InitIso;
    GK_U32 u32LinesPer500ms;
    GK_U32 u32PirisFNO;
    GK_U16 u16WBRgain;
    GK_U16 u16WBGgain;
    GK_U16 u16WBBgain;
    GK_U16 u16SampleRgain;
    GK_U16 u16SampleBgain;
    GK_U16 au16CCM[CCM_MATRIX_SIZE];
} ISP_INIT_ATTR_S ;

/* ISP debug information */
typedef struct ISP_DEBUG_INFO_S {
    GK_BOOL bDebugEn;       /* RW; 1:enable debug, 0:disable debug */
    GK_U64  u64PhyAddr;     /* RW; phy address of debug info */
    GK_U32  u32Depth;       /* RW; depth of debug info */
} ISP_DEBUG_INFO_S;

typedef struct ISP_DBG_ATTR_S {
    GK_U32  u32Rsv;         /* H;need to add member */
} ISP_DBG_ATTR_S;

typedef struct ISP_DBG_STATUS_S {
    GK_U32  u32FrmNumBgn;
    GK_U32  u32Rsv;         /* H;need to add member */
    GK_U32  u32FrmNumEnd;
} ISP_DBG_STATUS_S;

/*
0 = Communication between the sensor and the ISP over the I2C interface
1 = Communication between the sensor and the ISP over the SSP interface
*/
typedef enum ISP_SNS_TYPE_E {
    ISP_SNS_I2C_TYPE = 0,
    ISP_SNS_SSP_TYPE,

    ISP_SNS_TYPE_BUTT,
} ISP_SNS_TYPE_E;

/* sensor communication bus */
typedef union ISP_SNS_COMMBUS_U {
    GK_S8   s8I2cDev;
    struct {
        GK_S8  bit4SspDev       : 4;
        GK_S8  bit4SspCs        : 4;
    } s8SspDev;
} ISP_SNS_COMMBUS_U;

typedef struct ISP_I2C_DATA_S {
    GK_BOOL bUpdate;            /* RW; Range: [0x0, 0x1]; Format:1.0; GK_TRUE: The sensor registers are written,GK_FALSE: The sensor registers are not written */
    GK_U8   u8DelayFrmNum;      /* RW; Number of delayed frames for the sensor register */
    GK_U8   u8IntPos;           /* RW;Position where the configuration of the sensor register takes effect
                                 0x0:very short frame start interrupt, 0x1:very short frame end interrupt,
                                 0x10:short frame start interrupt, 0x11:short frame end interrupt,
                                 0x20:middle frame start interrupt, 0x21:middle frame end interrupt,
                                 0x30:long frame start interrupt, 0x31:long frame end interrupt */

    GK_U8   u8DevAddr;          /* RW;Sensor device address */
    GK_U32  u32RegAddr;         /* RW;Sensor register address */
    GK_U32  u32AddrByteNum;     /* RW;Bit width of the sensor register address */
    GK_U32  u32Data;            /* RW;Sensor register data */
    GK_U32  u32DataByteNum;     /* RW;Bit width of sensor register data */
} ISP_I2C_DATA_S;

typedef struct ISP_SSP_DATA_S {
    GK_BOOL bUpdate;            /* RW; Range: [0x0, 0x1]; Format:1.0; GK_TRUE: The sensor registers are written,GK_FALSE: The sensor registers are not written */
    GK_U8   u8DelayFrmNum;      /* RW; Number of delayed frames for the sensor register */
    GK_U8   u8IntPos;           /* RW;Position where the configuration of the sensor register takes effect
                                 0x0:very short frame start interrupt, 0x1:very short frame end interrupt,
                                 0x10:short frame start interrupt, 0x11:short frame end interrupt,
                                 0x20:middle frame start interrupt, 0x21:middle frame end interrupt,
                                 0x30:long frame start interrupt, 0x31:long frame end interrupt */
    GK_U32  u32DevAddr;         /* RW;Sensor device address */
    GK_U32  u32DevAddrByteNum;  /* RW;Bit width of the sensor device address */
    GK_U32  u32RegAddr;         /* RW;Sensor register address */
    GK_U32  u32RegAddrByteNum;  /* RW;Bit width of the sensor register address */
    GK_U32  u32Data;            /* RW;Sensor register data */
    GK_U32  u32DataByteNum;     /* RW;Bit width of sensor register data */
} ISP_SSP_DATA_S;

typedef struct ISP_SNS_REGS_INFO_S {
    ISP_SNS_TYPE_E enSnsType;
    GK_U32  u32RegNum;              /* RW;Number of registers required when exposure results are written to the sensor. The member value cannot be dynamically changed */
    GK_U8   u8Cfg2ValidDelayMax;    /* RW;Maximum number of delayed frames from the time when all sensor registers are configured to the
                                      time when configurations take effect, which is used to ensure the synchronization between sensor registers and ISP registers */
    ISP_SNS_COMMBUS_U  unComBus;
    union {
        ISP_I2C_DATA_S astI2cData[ISP_MAX_SNS_REGS];
        ISP_SSP_DATA_S astSspData[ISP_MAX_SNS_REGS];
    };

    struct {
        GK_BOOL bUpdate;
        GK_U8   u8DelayFrmNum;
        GK_U32  u32SlaveVsTime;      /* RW;time of vsync. Unit: inck clock cycle */
        GK_U32  u32SlaveBindDev;
    } stSlvSync;

    GK_BOOL bConfig;
} ISP_SNS_REGS_INFO_S;

typedef enum ISP_VD_TYPE_E {
    ISP_VD_FE_START   = 0,
    ISP_VD_FE_END,
    ISP_VD_BE_END,

    ISP_VD_BUTT
} ISP_VD_TYPE_E;

/* Defines the attributes of the virtual addresses for the registers of ISP submodules */
typedef struct ISP_REG_ATTR_S {
    GK_VOID *pIspExtRegAddr;        /* R;Start virtual address for the ISP external virtual registers */
    GK_U32 u32IspExtRegSize;        /* R;Size of the ISP external virtual registers */
    GK_VOID *pAeExtRegAddr;         /* R;Start virtual address for the AE library module */
    GK_U32 u32AeExtRegSize;         /* R;Size of the AE library module */
    GK_VOID *pAwbExtRegAddr;        /* R;Start virtual address for the AWB library module */
    GK_U32 u32AwbExtRegSize;        /* R;Size of the AWB library module */
} ISP_REG_ATTR_S;


/******************************************************/
/********************* AI structs ************************/
/*
Defines the ISP iris type
0 = DC iris
1 = P iris
*/
typedef enum ISP_IRIS_TYPE_E {
    ISP_IRIS_DC_TYPE = 0,
    ISP_IRIS_P_TYPE,

    ISP_IRIS_TYPE_BUTT,
} ISP_IRIS_TYPE_E;

/*
Defines the F value of the ISP iris
*/
typedef enum ISP_IRIS_F_NO_E {
    ISP_IRIS_F_NO_32_0 = 0,
    ISP_IRIS_F_NO_22_0,
    ISP_IRIS_F_NO_16_0,
    ISP_IRIS_F_NO_11_0,
    ISP_IRIS_F_NO_8_0,
    ISP_IRIS_F_NO_5_6,
    ISP_IRIS_F_NO_4_0,
    ISP_IRIS_F_NO_2_8,
    ISP_IRIS_F_NO_2_0,
    ISP_IRIS_F_NO_1_4,
    ISP_IRIS_F_NO_1_0,

    ISP_IRIS_F_NO_BUTT,
} ISP_IRIS_F_NO_E;

typedef struct ISP_DCIRIS_ATTR_S {
    GK_S32 s32Kp;                    /* RW; Range:[0, 100000]; Format:32.0; the proportional gain of PID algorithm, default value is 7000 */
    GK_S32 s32Ki;                    /* RW; Range:[0, 1000]; Format:32.0; the integral gain of PID algorithm, default value is 100 */
    GK_S32 s32Kd;                    /* RW; Range:[0, 100000]; Format:32.0; the derivative gain of PID algorithm, default value is 3000 */
    GK_U32 u32MinPwmDuty;            /* RW; Range:[0, 1000]; Format:32.0; which is the min pwm duty for dciris control */
    GK_U32 u32MaxPwmDuty;            /* RW; Range:[0, 1000]; Format:32.0; which is the max pwm duty for dciris control */
    GK_U32 u32OpenPwmDuty;           /* RW; Range:[0, 1000]; Format:32.0; which is the open pwm duty for dciris control */
} ISP_DCIRIS_ATTR_S;

typedef struct ISP_PIRIS_ATTR_S {
    GK_BOOL bStepFNOTableChange;    /* W; Range:[0, 1]; Format:1.0; Step-F number mapping table change or not */
    GK_BOOL bZeroIsMax;             /* RW; Range:[0, 1]; Format:1.0; Step 0 corresponds to max aperture or not, it's related to the specific iris */
    GK_U16 u16TotalStep;            /* RW; Range:[1, 1024]; Format:16.0; Total steps of  Piris's aperture, it's related to the specific iris */
    GK_U16 u16StepCount;            /* RW; Range:[1, 1024]; Format:16.0; Used steps of Piris's aperture. when Piris's aperture is too small, the F number precision is not enough,
                                          so not all the steps can be used. It's related to the specific iris */
    GK_U16 au16StepFNOTable[AI_MAX_STEP_FNO_NUM];   /* RW; Range:[1, 1024]; Format:16.0; Step-F number mapping table. F1.0 is expressed as 1024, F32 is expressed as 1, it's related to the specific iris */
    ISP_IRIS_F_NO_E  enMaxIrisFNOTarget;  /* RW; Range:[0, 10]; Format:4.0; Max F number of Piris's aperture, it's related to the specific iris */
    ISP_IRIS_F_NO_E  enMinIrisFNOTarget;  /* RW; Range:[0, 10]; Format:4.0; Min F number of Piris's aperture, it's related to the specific iris */

    GK_BOOL bFNOExValid;            /* RW; Range:[0, 1]; Format:1.0; use equivalent gain to present FNO or not */
    GK_U32 u32MaxIrisFNOTarget;    /* RW; Range:[1, 1024]; Format:16.0; Max equivalent gain of F number of Piris's aperture, only used when bFNOExValid is true, it's related to the specific iris */
    GK_U32 u32MinIrisFNOTarget;    /* RW; Range:[1, 1024]; Format:16.0; Min equivalent gain of F number of Piris's aperture, only used when bFNOExValid is true, it's related to the specific iris */
} ISP_PIRIS_ATTR_S;

/* Defines the MI attribute */
typedef struct ISP_MI_ATTR_S {
    GK_U32  u32HoldValue;            /* RW; Range:[0, 1000]; Format:32.0; iris hold value for DC-iris */
    ISP_IRIS_F_NO_E  enIrisFNO;      /* RW; Range:[0, 10]; Format:4.0; the F number of P-iris */
} ISP_MI_ATTR_S;

/*
Defines the ISP iris status
0 = In this mode can set the MI holdvalue
1 = Open Iris to the max
2 = Close Iris to the min
*/
typedef enum ISP_IRIS_STATUS_E {
    ISP_IRIS_KEEP  = 0,
    ISP_IRIS_OPEN  = 1,
    ISP_IRIS_CLOSE = 2,
    ISP_IRIS_BUTT
} ISP_IRIS_STATUS_E;

/* Defines the iris attribute */
typedef struct ISP_IRIS_ATTR_S {
    GK_BOOL bEnable;                 /* RW;iris enable/disable */
    ISP_OP_TYPE_E   enOpType;        /* auto iris or manual iris */
    ISP_IRIS_TYPE_E enIrisType;      /* DC-iris or P-iris */
    ISP_IRIS_STATUS_E enIrisStatus;  /* RW; status of Iris */
    ISP_MI_ATTR_S   stMIAttr;
} ISP_IRIS_ATTR_S;


/******************************************************/
/********************* AE structs ************************/
/*
Defines the AE mode
0 = Automatic frame rate reduction mode (slow shutter mode)
1 = Constant frame rate mode
*/
typedef enum ISP_AE_MODE_E {
    AE_MODE_SLOW_SHUTTER = 0,
    AE_MODE_FIX_FRAME_RATE  = 1,
    AE_MODE_BUTT
} ISP_AE_MODE_E;
/*
Defines the AE exposure policy mode
0 = Highlight first exposure mode
1 = Lowlight first exposure mode
*/
typedef enum ISP_AE_STRATEGY_E {
    AE_EXP_HIGHLIGHT_PRIOR = 0,
    AE_EXP_LOWLIGHT_PRIOR  = 1,
    AE_STRATEGY_MODE_BUTT
} ISP_AE_STRATEGY_E;
/* Defines the maximum exposure time or gain and minimum exposure time or gain */
typedef struct ISP_AE_RANGE_S {
    GK_U32 u32Max;  /* RW;Range:[0,0xFFFFFFFF];Format:32.0;Maximum value */
    GK_U32 u32Min;  /* RW;Range:[0,0xFFFFFFFF];Format:32.0;limited Range:[0,u32Max],Minimum value */
} ISP_AE_RANGE_S;

/* Defines the ISP exposure delay attribute */
typedef struct ISP_AE_DELAY_S {
    GK_U16 u16BlackDelayFrame;    /* RW; Range:[0, 65535]; Format:16.0; AE black delay frame count */
    GK_U16 u16WhiteDelayFrame;    /* RW; Range:[0, 65535]; Format:16.0; AE white delay frame count */
} ISP_AE_DELAY_S;

/*
Defines the anti-flicker mode.
0 = The epxosure time is fixed to be the multiplies of 1/(2*frequency) sec,it may lead to over exposure in the high-luminance environments.
1 = The anti flicker may be closed to avoid over exposure in the high-luminance environments.
*/
typedef enum ISP_ANTIFLICKER_MODE_E {
    ISP_ANTIFLICKER_NORMAL_MODE = 0x0,
    ISP_ANTIFLICKER_AUTO_MODE   = 0x1,
    ISP_ANTIFLICKER_MODE_BUTT
} ISP_ANTIFLICKER_MODE_E;

/* Defines the anti-flicker attribute */
typedef struct ISP_ANTIFLICKER_S {
    GK_BOOL bEnable;              /* RW; Range:[0, 1]; Format:1.0; */
    GK_U8   u8Frequency;          /* RW; Range:[0, 255]; Format:8.0; usually this value is 50 or 60  which is the frequency of the AC power supply */
    ISP_ANTIFLICKER_MODE_E  enMode;
} ISP_ANTIFLICKER_S;

typedef struct ISP_SUBFLICKER_S {
    GK_BOOL bEnable; /* RW; Range:[0, 1]; Format:1.0; */

    GK_U8   u8LumaDiff;     /* RW; Range:[0, 100]; Format:8.0; if subflicker mode enable, current luma is less than AE compensation plus LumaDiff,
                                AE will keep min antiflicker shutter time(for example: 1/100s or 1/120s) to avoid flicker. while current luma is
                                larger than AE compensation plus the LumaDiff, AE will reduce shutter time to avoid over-exposure and introduce
                                flicker in the pircture */
} ISP_SUBFLICKER_S;

/*
Defines the ISP FSWDR operating mode
0 = Normal FSWDR mode
1 = Long frame mode, only effective in LINE_WDR, when running in this mode FSWDR module only output the long frame data
*/
typedef enum ISP_FSWDR_MODE_E {
    ISP_FSWDR_NORMAL_MODE          = 0x0,
    ISP_FSWDR_LONG_FRAME_MODE      = 0x1,
    ISP_FSWDR_AUTO_LONG_FRAME_MODE = 0x2, /* Auto long frame mode, only effective in LINE_WDR, When running in this mode, normal WDR and long frame mode would auto switch */
    ISP_FSWDR_MODE_BUTT
} ISP_FSWDR_MODE_E;


typedef struct ISP_AE_ATTR_S {
    /* base parameter */
    ISP_AE_RANGE_S stExpTimeRange;   /* RW; Range:[0x0, 0xFFFFFFFF]; Format:32.0; sensor exposure time (unit: us ), it's related to the specific sensor */
    ISP_AE_RANGE_S stAGainRange;     /* RW; Range:[0x400, 0xFFFFFFFF]; Format:22.10; sensor analog gain (unit: times, 10bit precision), it's related to the specific sensor */
    ISP_AE_RANGE_S stDGainRange;     /* RW; Range:[0x400, 0xFFFFFFFF]; Format:22.10;  sensor digital gain (unit: times, 10bit precision), it's related to the specific sensor */
    ISP_AE_RANGE_S stISPDGainRange;  /* RW; Range:[0x400, 0x40000]; Format:22.10;  ISP digital gain (unit: times, 10bit precision), it's related to the ISP digital gain range */
    ISP_AE_RANGE_S stSysGainRange;   /* RW; Range:[0x400, 0xFFFFFFFF]; Format:22.10;  system gain (unit: times, 10bit precision), it's related to the specific sensor and ISP Dgain range */
    GK_U32 u32GainThreshold;         /* RW; Range:[0x400, 0xFFFFFFFF]; Format:22.10;  Gain threshold for slow shutter mode (unit: times, 10bit precision) */

    GK_U8  u8Speed;                  /* RW; Range:[0x0, 0xFF]; Format:8.0; AE adjust step for dark scene to bright scene switch */
    GK_U16  u16BlackSpeedBias;       /* RW; Range:[0x0, 0xFFFF]; Format:16.0; AE adjust step bias for bright scene to dark scene switch */
    GK_U8  u8Tolerance;              /* RW; Range:[0x0, 0xFF]; Format:8.0; AE adjust tolerance */
    GK_U8  u8Compensation;           /* RW; Range:[0x0, 0xFF]; Format:8.0; AE compensation */
    GK_U16  u16EVBias;               /* RW; Range:[0x0, 0xFFFF]; Format:16.0; AE EV bias */
    ISP_AE_STRATEGY_E enAEStrategyMode;  /* RW; Range:[0, 1]; Format:1.0; Support Highlight prior or Lowlight prior */
    GK_U16  u16HistRatioSlope;       /* RW; Range:[0x0, 0xFFFF]; Format:16.0; AE hist ratio slope */
    GK_U8   u8MaxHistOffset;         /* RW; Range:[0x0, 0xFF]; Format:8.0; Max hist offset */

    ISP_AE_MODE_E  enAEMode;         /* RW; Range:[0, 1]; Format:1.0; AE mode(slow shutter/fix framerate)(onvif) */
    ISP_ANTIFLICKER_S stAntiflicker;
    ISP_SUBFLICKER_S stSubflicker;
    ISP_AE_DELAY_S stAEDelayAttr;

    GK_BOOL bManualExpValue;         /* RW; Range:[0, 1]; Format:1.0; manual exposure value or not */
    GK_U32 u32ExpValue;              /* RW; Range:(0x0, 0xFFFFFFFF]; Format:32.0; manual exposure value */

    ISP_FSWDR_MODE_E enFSWDRMode;    /* RW; Range:[0, 2]; Format:2.0; FSWDR running mode */
    GK_BOOL bWDRQuick;               /* RW; Range:[0, 1]; Format:1.0; WDR use delay strategy or not; If is true, WDR AE adjust will be faster */

    GK_U16  u16ISOCalCoef;     /* RW; Range:[0x0, 0xFFFF]; Format:8.8; The coefficient between Standard ISO and origin ISO (unit: times, 8bit precision) */
} ISP_AE_ATTR_S;

typedef struct ISP_ME_ATTR_S {
    ISP_OP_TYPE_E enExpTimeOpType;
    ISP_OP_TYPE_E enAGainOpType;
    ISP_OP_TYPE_E enDGainOpType;
    ISP_OP_TYPE_E enISPDGainOpType;

    GK_U32 u32ExpTime;        /* RW; Range:[0x0, 0xFFFFFFFF]; Format:32.0; sensor exposure time (unit: us ), it's related to the specific sensor */
    GK_U32 u32AGain;          /* RW; Range:[0x400, 0xFFFFFFFF]; Format:22.10; sensor analog gain (unit: times, 10bit precision), it's related to the specific sensor */
    GK_U32 u32DGain;          /* RW; Range:[0x400, 0xFFFFFFFF]; Format:22.10; sensor digital gain (unit: times, 10bit precision), it's related to the specific sensor */
    GK_U32 u32ISPDGain;       /* RW; Range:[0x400, 0x40000]; Format:22.10; ISP digital gain (unit: times, 10bit precision), it's related to the ISP digital gain range */
} ISP_ME_ATTR_S;

typedef struct ISP_EXPOSURE_ATTR_S {
    GK_BOOL         bByPass;    /* RW; Range:[0, 1]; Format:1.0; */
    ISP_OP_TYPE_E   enOpType;
    GK_U8     u8AERunInterval;  /* RW; Range:[0x1, 0xFF]; Format:8.0; set the AE run interval */
    GK_BOOL   bHistStatAdjust;  /* RW; Range:[0, 1]; Format:1.0;  GK_TRUE: 256 bin histogram statistic config will adjust when large red or blue area detected.
                                                        GK_FALSE: 256 bin histogram statistic config will not change */
    GK_BOOL   bAERouteExValid;  /* RW; Range:[0, 1]; Format:1.0; use extend AE route or not */
    ISP_ME_ATTR_S   stManual;
    ISP_AE_ATTR_S   stAuto;
    ISP_PRIOR_FRAME_E enPriorFrame;  /* RW; Range:[0, 3]; Format:1.0; AE prior frame */
    GK_BOOL   bAEGainSepCfg;  /* RW; Range:[0, 1]; Format:1.0; long and short frame gain separately configure or not */
} ISP_EXPOSURE_ATTR_S;


#define ISP_AE_ROUTE_MAX_NODES                    (16)
typedef struct ISP_AE_ROUTE_NODE_S {
    GK_U32  u32IntTime;          /* RW; Range:(0x0, 0xFFFFFFFF]; Format:32.0; sensor exposure time (unit: us ), it's related to the specific sensor */
    GK_U32  u32SysGain;          /* RW; Range:[0x400, 0xFFFFFFFF]; Format:22.10; system gain (unit: times, 10bit precision), it's related to the specific sensor and ISP Dgain range */
    ISP_IRIS_F_NO_E  enIrisFNO;  /* RW; Range:[0, 10]; Format:4.0; the F number of the iris's aperture, only support for Piris */
    GK_U32  u32IrisFNOLin;       /* RW; Range:[0x1, 0x400]; Format:32.0; the equivalent gain of F number of the iris's aperture, only support for Piris */
} ISP_AE_ROUTE_NODE_S;

typedef struct ISP_AE_ROUTE_S {
    GK_U32 u32TotalNum;     /* RW; Range:[0, 0x10]; Format:8.0; total node number of AE route */
    ISP_AE_ROUTE_NODE_S astRouteNode[ISP_AE_ROUTE_MAX_NODES];
} ISP_AE_ROUTE_S;

#define ISP_AE_ROUTE_EX_MAX_NODES                 (16)
typedef struct ISP_AE_ROUTE_EX_NODE_S {
    GK_U32  u32IntTime;     /* RW; Range:(0x0, 0xFFFFFFFF]; Format:32.0;  sensor exposure time (unit: us ), it's related to the specific sensor */
    GK_U32  u32Again;       /* RW; Range:[0x400, 0x3FFFFF]; Format:22.10;  sensor analog gain (unit: times, 10bit precision), it's related to the specific sensor */
    GK_U32  u32Dgain;       /* RW; Range:[0x400, 0x3FFFFF]; Format:22.10;  sensor digital gain (unit: times, 10bit precision), it's related to the specific sensor */
    GK_U32  u32IspDgain;    /* RW; Range:[0x400, 0x40000]; Format:22.10;  ISP digital gain (unit: times, 10bit precision) */
    ISP_IRIS_F_NO_E  enIrisFNO;  /* RW; Range:[0, 10]; Format:4.0; the F number of the iris's aperture, only support for Piris */
    GK_U32  u32IrisFNOLin;  /* RW; Range:[0x1, 0x400]; Format:32.0; the equivalent gain of F number of the iris's aperture, only support for Piris */
} ISP_AE_ROUTE_EX_NODE_S;

typedef struct ISP_AE_ROUTE_EX_S {
    GK_U32 u32TotalNum;       /* RW; Range:[0, 0x10]; Format:8.0; total node number of extend AE route */
    ISP_AE_ROUTE_EX_NODE_S astRouteExNode[ISP_AE_ROUTE_EX_MAX_NODES];
} ISP_AE_ROUTE_EX_S;

typedef struct ISP_EXP_INFO_S {
    GK_U32 u32ExpTime;                 /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; */
    GK_U32 u32ShortExpTime;            /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; */
    GK_U32 u32MedianExpTime;           /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; */
    GK_U32 u32LongExpTime;             /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; */
    GK_U32 u32AGain;                   /* R; Range:[0x400, 0xFFFFFFFF]; Format:22.10; */
    GK_U32 u32DGain;                   /* R; Range:[0x400, 0xFFFFFFFF]; Format:22.10; */
    GK_U32 u32AGainSF;                 /* R; Range:[0x400, 0xFFFFFFFF]; Format:22.10; */
    GK_U32 u32DGainSF;                 /* R; Range:[0x400, 0xFFFFFFFF]; Format:22.10; */
    GK_U32 u32ISPDGain;                /* R; Range:[0x400, 0xFFFFFFFF]; Format:22.10; */
    GK_U32 u32Exposure;                /* R; Range:[0x40, 0xFFFFFFFF]; Format:26.6; */
    GK_BOOL bExposureIsMAX;            /* R; Range:[0, 1]; Format:1.0; */
    GK_S16 s16HistError;               /* R; Range:[-32768, 32767]; Format:16.0; */
    GK_U32 au32AE_Hist1024Value[HIST_NUM]; /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; 1024 bins histogram for channel 1 */

    GK_U8  u8AveLum;                   /* R; Range:[0x0, 0xFF]; Format:8.0; */
    GK_U32 u32LinesPer500ms;           /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; exposure lines per 500ms */
    GK_U32 u32PirisFNO;                /* R; Range:[0x0, 0x400]; Format:32.0; */
    GK_U32 u32Fps;                     /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; actual fps */
    GK_U32 u32ISO;                     /* R; Range:[0x64, 0xFFFFFFFF]; Format:32.0; */
    GK_U32 u32ISOSF;                   /* R; Range:[0x64, 0xFFFFFFFF]; Format:32.0; */
    GK_U32 u32ISOCalibrate;            /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; */
    GK_U32 u32RefExpRatio;             /* R; Range:[0x40, 0x4000]; Format:26.6; */
    GK_U32 u32FirstStableTime;         /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; AE first stable time for quick start */
    ISP_AE_ROUTE_S stAERoute;          /* R; Actual AE route */
    ISP_AE_ROUTE_EX_S stAERouteEx;     /* R; Actual AE route_ex */
    ISP_AE_ROUTE_S stAERouteSF;          /* R; Actual AE route_sf */
    ISP_AE_ROUTE_EX_S stAERouteSFEx;     /* R; Actual AE route_sf_ex */
} ISP_EXP_INFO_S;


#define EXP_RATIO_NUM                             (3)
typedef struct ISP_WDR_EXPOSURE_ATTR_S {
    ISP_OP_TYPE_E enExpRatioType;   /* RW; Range:[0, 1]; Format:1.0; OP_TYPE_AUTO: The ExpRatio used in ISP is generated by firmware; OP_TYPE_MANUAL: The ExpRatio used in ISP is set by u32ExpRatio */
    GK_U32 au32ExpRatio[EXP_RATIO_NUM];             /* RW; Range:[0x40, 0xFFF]; Format:26.6; 0x40 means 1 times.
                                            When enExpRatioType is OP_TYPE_AUTO, u32ExpRatio is invalid.
                                            When enExpRatioType is OP_TYPE_MANUAL, u32ExpRatio is quotient of long exposure time / short exposure time. */
    GK_U32 u32ExpRatioMax;          /* RW; Range:[0x40, 0x4000]; Format:26.6; 0x40 means 1 times.
                                            When enExpRatioType is OP_TYPE_AUTO, u32ExpRatioMax is max(upper limit) of ExpRatio generated by firmware.
                                            When enExpRatioType is OP_TYPE_MANUAL, u32ExpRatioMax is invalid. */
    GK_U32 u32ExpRatioMin;          /* RW; Range:[0x40, 0x4000]; Format:26.6; limited Range:[0x40, u32ExpRatioMax],0x40 means 1 times.
                                            When enExpRatioType is OP_TYPE_AUTO, u32ExpRatioMin is min(lower limit) of ExpRatio generated by firmware.
                                            When enExpRatioType is OP_TYPE_MANUAL, u32ExpRatioMin is invalid. */
    GK_U16 u16Tolerance;            /* RW; Range:[0x0, 0xFF]; Format:8.0;et the dynamic range tolerance. Format: unsigned 6.2-bit fixed-point. 0x4 means 1dB. */
    GK_U16 u16Speed;                /* RW; Range:[0x0, 0xFF]; Format:8.0; exposure ratio adjust speed */
    GK_U16 u16RatioBias;            /* RW; Range:[0x0, 0xFFFF]; Format:16.0; exposure ratio bias */

} ISP_WDR_EXPOSURE_ATTR_S;

typedef struct ISP_HDR_EXPOSURE_ATTR_S {
    ISP_OP_TYPE_E enExpHDRLvType;   /* RW; Range:[0, 1]; Format:1.0; OP_TYPE_AUTO: The ExpHDRLv used in ISP is generated by firmware; OP_TYPE_MANUAL: The ExpHDRLv used in ISP is set by u32ExpHDRLv */
    GK_U32 u32ExpHDRLv;             /* RW; Range:[0x40, 0x400]; Format:26.6; 0x40 means 1 times.
                                            When enExpHDRLvType is OP_TYPE_AUTO, u32ExpHDRLv is invalid.
                                            When enExpHDRLvType is OP_TYPE_MANUAL, u32ExpHDRLv is the quotient of exposure / linear exposure. */
    GK_U32 u32ExpHDRLvMax;          /* RW; Range:[0x40, 0x400]; Format:26.6; 0x40 means 1 times.
                                            When enExpHDRLvType is OP_TYPE_AUTO, u32ExpHDRLvMax is max(upper limit) of ExpHDRLv generated by firmware.
                                            When enExpHDRLvType is OP_TYPE_MANUAL, u32ExpHDRLvMax is invalid. */
    GK_U32 u32ExpHDRLvMin;          /* RW; Range:[0x40, 0x400]; Format:26.6; limited range:[0x40, u32ExpHDRLvMax],0x40 means 1 times.
                                            When enExpHDRLvType is OP_TYPE_AUTO, u32ExpHDRLvMin is min(lower limit) of ExpHDRLv generated by firmware.
                                            When enExpHDRLvType is OP_TYPE_MANUAL, u32ExpHDRLvMin is invalid. */
    GK_U32 u32ExpHDRLvWeight;       /* RW; Range:[0x0, 0x400]; Format:16.0; exposure HDR level weight. */

} ISP_HDR_EXPOSURE_ATTR_S;

typedef struct ISP_SMART_EXPOSURE_ATTR_S {
    GK_BOOL bEnable;                /* RW; Range:[0, 1]; Format:1.0; smart ae enable or not */
    GK_BOOL bIRMode;                /* RW; Range:[0, 1]; Format:1.0; smart ae IR mode or not */
    ISP_OP_TYPE_E enSmartExpType;   /* RW; Range:[0, 1]; Format:1.0; OP_TYPE_AUTO: The ExpCoef used in ISP is generated by firmware; OP_TYPE_MANUAL: The ExpCoef used in ISP is set by u32ExpCoef */
    GK_U16  u16ExpCoef;             /* RW; Range:[0x0, 0xFFFF]; Format:6.10; 0x400 means 1 times.
                                            When enExpHDRLvType is OP_TYPE_AUTO, u32ExpCoef is invalid.
                                            When enExpHDRLvType is OP_TYPE_MANUAL, u32ExpCoef is the quotient of exposure. */
    GK_U8   u8LumaTarget;           /* RW; Range:[0x0, 0xFF]; Format:8.0; luma target of smart ae. */
    GK_U16  u16ExpCoefMax;          /* RW; Range:[0x0, 0xFFFF]; Format:6.10; 0x400 means 1 times.
                                            When enExpHDRLvType is OP_TYPE_AUTO, u32ExpCoefvMax is max(upper limit) of ExpCoef generated by firmware.
                                            When enExpHDRLvType is OP_TYPE_MANUAL, u32ExpCoefMax is invalid. */
    GK_U16  u16ExpCoefMin;          /* RW; Range:[0x0, 0xFFFF]; Format:6.10; 0x400 means 1 times.
                                            When enExpHDRLvType is OP_TYPE_AUTO, u32ExpCoefMax is min(lower limit) of ExpCoef generated by firmware.
                                            When enExpHDRLvType is OP_TYPE_MANUAL, u32ExpCoefMin is invalid. */
    GK_U8   u8SmartInterval;        /*RW; Range:[0x1, 0xFF]; Format:8.0; smart ae run interval*/
    GK_U8   u8SmartSpeed;           /*RW; Range:[0x0, 0xFF]; Format:8.0; smart ae adjust step*/
    GK_U16  u16SmartDelayNum;       /*RW; Range:[0x0, 0x400]; Format:16.0; smart ae adjust delay frame num */
} ISP_SMART_EXPOSURE_ATTR_S;


/********************* AWB structs ************************/
/*
Defines the AWB online calibration type
u16AvgRgain: the avg value of Rgain after online calibration
u16AvgBgain: the avg value of Bgain after online calibration
*/
typedef struct ISP_AWB_Calibration_Gain_S {
    GK_U16 u16AvgRgain;
    GK_U16 u16AvgBgain;
} ISP_AWB_Calibration_Gain_S;
/*
Defines the AWB algorithm type
0 = Improved gray world algorithm.
1 = AWB algorithm that classifies the statistics and re-filters the white blocks
*/
typedef enum ISP_AWB_ALG_TYPE_E {
    AWB_ALG_LOWCOST = 0,
    AWB_ALG_ADVANCE = 1,
    AWB_ALG_BUTT
} ISP_AWB_ALG_TYPE_E;

/*
Defines the AWB policy in the multi-illuminant scenario
0 = Automatic saturation adjustment in the multi-illuminant scenario
1 = Automatic ccm adjustment in the multi-illuminant scenario
*/
typedef enum ISP_AWB_MULTI_LS_TYPE_E {
    AWB_MULTI_LS_SAT = 0,
    AWB_MULTI_LS_CCM = 1,
    AWB_MULTI_LS_BUTT
} ISP_AWB_MULTI_LS_TYPE_E;

typedef enum ISP_AWB_INDOOR_OUTDOOR_STATUS_E {
    AWB_INDOOR_MODE = 0,
    AWB_OUTDOOR_MODE = 1,
    AWB_INDOOR_OUTDOOR_BUTT
} ISP_AWB_INDOOR_OUTDOOR_STATUS_E;

/* Defines the AWB gain range */
typedef struct ISP_AWB_CT_LIMIT_ATTR_S {
    GK_BOOL bEnable;
    ISP_OP_TYPE_E   enOpType;

    GK_U16 u16HighRgLimit;     /* RW; Range:[0x0, 0xFFF]; Format:4.8; in Manual Mode, user define the Max Rgain of High Color Temperature */
    GK_U16 u16HighBgLimit;     /* RW; Range:[0x0, 0xFFF]; Format:4.8; in Manual Mode, user define the Min Bgain of High Color Temperature */
    GK_U16 u16LowRgLimit;      /* RW; Range:[0x0, 0xFFF]; Format:4.8; limited range:[0x0, u16HighRgLimit),in Manual Mode, user define the Min Rgain of Low Color Temperature */
    GK_U16 u16LowBgLimit;      /* RW; Range:[0, 0xFFF]; Format:4.8; limited Range:(u16HighBgLimit, 0xFFF],in Manual Mode, user define the Max Bgain of Low Color Temperature */
} ISP_AWB_CT_LIMIT_ATTR_S;

typedef struct ISP_AWB_IN_OUT_ATTR_S {
    GK_BOOL bEnable;                                    /* RW; Range:[0, 1]; Format:1.0; Outdoor/Indoor scenario determination enable */
    ISP_OP_TYPE_E   enOpType;
    ISP_AWB_INDOOR_OUTDOOR_STATUS_E  enOutdoorStatus;   /* RW;User should config indoor or outdoor status in Manual Mode */
    GK_U32 u32OutThresh;                                /* RW;Format:32.0;shutter time(in us) to judge indoor or outdoor */
    GK_U16 u16LowStart;                                 /* RW;Format:16.0;5000K is recommend */
    GK_U16 u16LowStop;                                  /* RW;Format:16.0;limited range:(0,u16LowStart),4500K is recommend, should be smaller than u8LowStart */
    GK_U16 u16HighStart;                                /* RW;Format:16.0;limited range:(u16LowStart,0xFFFF],6500K is recommend, shoule be larger than u8LowStart */
    GK_U16 u16HighStop;                                 /* RW;Format:16.0;limited range:(u16HighStart,0xFFFF],8000K is recommend, should be larger than u8HighStart */
    GK_BOOL bGreenEnhanceEn;                            /* RW; Range:[0, 1]; Format:1.0;If this is enabled, Green channel will be enhanced based on the ratio of green plant */
    GK_U8   u8OutShiftLimit;                            /* RW; Range:[0, 0xFF]; Format:8.0;Max white point zone distance to Planckian Curve */
} ISP_AWB_IN_OUT_ATTR_S;

typedef struct ISP_AWB_CBCR_TRACK_ATTR_S {
    GK_BOOL bEnable;                                /* RW; Range:[0, 1]; Format:1.0;If enabled, statistic parameter cr, cb will change according to iso */

    GK_U16  au16CrMax[ISP_AUTO_ISO_STRENGTH_NUM];   /* RW; Range:[0x0, 0xFFF]; au16CrMax[i] >= au16CrMin[i] */
    GK_U16  au16CrMin[ISP_AUTO_ISO_STRENGTH_NUM];   /* RW; Range:[0x0, 0xFFF] */
    GK_U16  au16CbMax[ISP_AUTO_ISO_STRENGTH_NUM];   /* RW; Range:[0x0, 0xFFF]; au16CbMax[i] >= au16CbMin[i] */
    GK_U16  au16CbMin[ISP_AUTO_ISO_STRENGTH_NUM];   /* RW; Range:[0x0, 0xFFF] */
} ISP_AWB_CBCR_TRACK_ATTR_S;

#define AWB_LUM_HIST_NUM                          (6)
/* Defines the parameters of the luminance histogram statistics for white balance */
typedef struct ISP_AWB_LUM_HISTGRAM_ATTR_S {
    GK_BOOL bEnable;                          /* RW; Range:[0, 1]; Format:1.0; If enabled, zone weight to awb is combined with zone luma */
    ISP_OP_TYPE_E   enOpType;                 /* In auto mode, the weight distribution follows Gaussian distribution */
    GK_U8   au8HistThresh[AWB_LUM_HIST_NUM];  /* RW; Range:[0x0, 0xFF]; Format:8.0; In manual mode, user define luma thresh, thresh[0] = 0, thresh[5] = 0xFF,  thresh[i] >=  thresh[i-1] */
    GK_U16  au16HistWt[AWB_LUM_HIST_NUM];     /* RW; Range:[0x0, 0xFFFF]; Format:16.0; user can define luma weight in both manual and auto mode. */
} ISP_AWB_LUM_HISTGRAM_ATTR_S;

/* Defines the information about a separate illuminant */
typedef struct ISP_AWB_LIGHTSOURCE_INFO_S {
    GK_U16 u16WhiteRgain;         /* RW;Range:[0x0, 0xFFF]; Format:4.8; G/R of White points at this light source */
    GK_U16 u16WhiteBgain;         /* RW;Range:[0x0, 0xFFF]; Format:4.8; G/B of White points at this light source */
    GK_U16 u16ExpQuant;           /* RW;shutter time * again * dgain >> 4, Not support Now */
    GK_U8  u8LightStatus;         /* RW;Range:[0,2]; Format:2.0; idle  1:add light source  2:delete sensitive color */
    GK_U8  u8Radius;              /* RW;Range:[0x0, 0xFF];  Format:8.0; Radius of light source, */
} ISP_AWB_EXTRA_LIGHTSOURCE_INFO_S;

#define AWB_LS_NUM                                (4)
#define AWB_MULTI_CT_NUM                          (8)
/* extended AWB attributes */
typedef struct ISP_AWB_ATTR_EX_S {
    GK_U8  u8Tolerance;                                 /* RW; Range:[0x0, 0xFF]; Format:8.0; AWB adjust tolerance */
    GK_U8  u8ZoneRadius;                                /* RW; Range:[0x0, 0xFF]; Format:8.0; radius of AWB blocks */
    GK_U16 u16CurveLLimit;                              /* RW; Range:[0x0, 0x100]; Format:9.0; Left limit of AWB Curve, recomend for indoor 0xE0, outdoor 0xE0 */
    GK_U16 u16CurveRLimit;                              /* RW; Range:[0x100, 0xFFF]; Format:12.0; Right Limit of AWB Curve,recomend for indoor 0x130, outdoor 0x120 */

    GK_BOOL  bExtraLightEn;                             /* RW; Range:[0, 1]; Format:1.0; Enable special light source function */
    ISP_AWB_EXTRA_LIGHTSOURCE_INFO_S    stLightInfo[AWB_LS_NUM];
    ISP_AWB_IN_OUT_ATTR_S               stInOrOut;

    GK_BOOL bMultiLightSourceEn;                        /* RW; Range:[0, 1]; Format:1.0; If enabled, awb will do special process in multi light source enviroment */
    ISP_AWB_MULTI_LS_TYPE_E enMultiLSType;              /* Saturation or CCM Tunning */
    GK_U16  u16MultiLSScaler;                           /* RW; Range:[0x0, 0x100];  Format:12.0; In saturation type, it means the max saturation it can achieve, in ccm type, it means the strenght of multi process. */
    GK_U16  au16MultiCTBin[AWB_MULTI_CT_NUM];           /* RW; Range:[0, 0XFFFF]; Format:16.0;AWB Support divide the color temperature range by 8 bins */
    GK_U16  au16MultiCTWt[AWB_MULTI_CT_NUM];            /* RW; Range:[0x0, 0x400];Weight for different color temperature, same value of 8 means CT weight does't work, */

    GK_BOOL bFineTunEn;                                 /* RW; Range:[0x0, 0x1]; Format:1.0;If enabled, skin color scene will be optimized */
    GK_U8   u8FineTunStrength;                          /* RW; Range:[0x0, 0xFF]; Format:8.0;larger value means better performance of skin color scene, but will increase error probability in low color temperature scene */
} ISP_AWB_ATTR_EX_S;

#define AWB_CURVE_PARA_NUM                        (6)
typedef struct ISP_AWB_ATTR_S {
    GK_BOOL bEnable;               /* RW; Range:[0x0, 0x1]; Format:1.0;If AWB is disabled, static wb gain will be used, otherwise auto wb gain will be used */

    GK_U16 u16RefColorTemp;        /* RW; Range:[0x0, 0xFFFF]; Format:16.0; Calibration Information */
    GK_U16 au16StaticWB[ISP_BAYER_CHN_NUM];        /* RW; Range:[0x0, 0xFFF]; Format:12.0;Calibration Information */
    GK_S32 as32CurvePara[AWB_CURVE_PARA_NUM];       /* RW; Format:32.0;Calibration Information,limited Range:as32CurvePara[3] != 0, as32CurvePara[4]==128 */

    ISP_AWB_ALG_TYPE_E          enAlgType;

    GK_U8  u8RGStrength;                            /* RW; Range: [0x0, 0xFF]; Format:8.0; AWB Strength of R Channel */
    GK_U8  u8BGStrength;                            /* RW; Range: [0x0, 0xFF]; Format:8.0; AWB Strength of B Channel */
    GK_U16 u16Speed;                                /* RW; Range: [0x0, 0xFFF]; Format:12.0; Convergence speed of AWB  */
    GK_U16 u16ZoneSel;                              /* RW; Range: [0, 255]; Format:8.0; A value of 0 or 0xFF means global AWB, A value between 0 and 0xFF means zoned AWB */
    GK_U16 u16HighColorTemp;                        /* RW; Range: [0, 65535]; Format:16.0; AWB max temperature, Recommended: [8500, 10000] */
    GK_U16 u16LowColorTemp;                         /* RW; Range: [0, 65535]; Format:16.0; Limited Range:[0, u16HighColorTemp), AWB min temperature, Recommended: [2000, 2500] */
    ISP_AWB_CT_LIMIT_ATTR_S   stCTLimit;
    GK_BOOL bShiftLimitEn;                          /* RW; Range: [0, 1]; Format:1.0; If enabled, when the statistic information is out of range, it should be project back */
    GK_U8  u8ShiftLimit;                            /* RW; Range: [0x0, 0xFF];  Format:8.0; planckian curve range, Recommended: [0x30, 0x50] */
    GK_BOOL bGainNormEn;                            /* RW; Range: [0, 1]; Format:1.0; if enabled, the min of RGB gain is fixed. */
    GK_BOOL bNaturalCastEn;                         /* RW, Range: [0, 1]; Format:1.0; if enabled, the color performance will be natural in lowlight and low color temperature */

    ISP_AWB_CBCR_TRACK_ATTR_S stCbCrTrack;
    ISP_AWB_LUM_HISTGRAM_ATTR_S stLumaHist;
    GK_BOOL bAWBZoneWtEn;                           /* RW, Range: [0, 1]; Format:1.0; if enabled, user can set weight for each zones */
    GK_U8   au8ZoneWt[AWB_ZONE_ORIG_ROW *AWB_ZONE_ORIG_COLUMN];   /* RW; Range: [0, 255]; Format:8.0;Zone Wt Table */
} ISP_AWB_ATTR_S;

/* Attr for SPC AWB */
#define SPECAWB_FACTTBL_ELMNUM                    (7)          /* Table number. */
#define SPECAWB_FACTTBL_SIZE                      (64)         /* Table size for weight for light source detection. */
#define SPECAWB_BBL_SIZE                          (40)         /* Table size for BlackBodyTable. */

typedef struct ISP_SPECAWB_BBL_TBL_S {
    GK_S16 s16Kelvin;   /* RW;Range:[-32768, 32767];Kelvin */
    GK_S16 s16Wbr;      /* RW;Range:[-32768, 32767];WBR value */
    GK_S16 s16Wbb;      /* RW;Range:[-32768, 32767];WBB value */
} ISP_SPECAWB_BBL_TBL_S;

typedef struct ISP_SPECAWB_KELVIN_DBB_MAP_S {
    GK_S16 s16Kelvin; /* RW;Range:[-32768, 32767];kevin */
    GK_S16 s16DBB;   /* RW;Range:[-32768, 32767];DeltaBlackBody */
} ISP_SPECAWB_KELVIN_DBB_MAP_S;

typedef struct ISP_SPECKCWB_S {
    GK_S32    s32RGain; /* RW;Range:[-2147483648, 2147483647]; RgainValue */
    GK_S32    s32BGain; /* RW;Range:[-2147483648, 2147483647]; BgainValue */
} ISP_SPECKCWB_S;

typedef struct ISP_SPECKCWBS16_S {
    GK_S16    s16RGain; /* RW;Range:[-32768, 32767]; RgainValue(16bit) */
    GK_S16    s16BGain; /* RW;Range:[-32768, 32767]; BgainValue(16bit) */
} ISP_SPECKCWBS16_S;

typedef struct ISP_SPECAWB_FACTTBL_ELEMENT_S {
    GK_S16    s16Bv;                             /* RW;Range:[-32768, 32767]; The center value of the Bv value targeted by this table. */
    GK_U8     u8FactTbl[SPECAWB_FACTTBL_SIZE][SPECAWB_FACTTBL_SIZE];     /* RW;Range:[0, 0xFF]; Weight for light source detection. */
} ISP_SPECAWB_FACTTBL_ELEMENT_S;

typedef struct ISP_SPECAWB_ATTR_S {
    ISP_SPECKCWB_S                       stWBCenter;                 /* RW;WB gain value at the center of the table: The table index is calculated as a relative value from this gain. */
    ISP_SPECKCWB_S                       stWBMin;                    /* RW;Minimum value of WB gain that the table covers. */
    ISP_SPECKCWB_S                       stWBMax;                    /* RW;Maximum value of WB gain that the table covers. */
    ISP_SPECKCWB_S                       stLogFact;                  /* RW;Range covered by the table: 1/exp(stLogFact) to exp(stLogFact). For example, if it is 1.0, WBDelta will be 1/e to e. However, e = 2.71828 ... (base of natural logarithm) */
    GK_S32                               s32LimitFactMin;            /* RW;Range:[0, s32LimitFactMax];AWB statics threshold value : minimum threshold value of ratio to pixel maximum value. */
    GK_S32                               s32LimitFactMax;            /* RW;Range:[s32LimitFactMin, 0xFFFF];AWB statics threshold value : maximum threshold value of ratio to pixel maximum value. */
    GK_S32                               s32LimitFactLimit;          /* RW;Range:[0x600, 0x4000];AWB statics limit value : ratio to (pixel maximum value * s32LimitFactMax) */
    GK_S32                               s32FactOffset;              /* RW;Range:[0, 0x800];The offset value of the weight when calculating the AWB statics. */
    GK_S32                               s32BFact;                   /* RW;Range:[0x399, 0x500];The value of specular weight when calculating the AWB statics. */
    GK_S32                               s32ACntMin;                 /* RW;Range:[0, 0x20];Threshold for block adoption.  If the integrated value of the AWB statics is less than m_ACntMin, the block is ignored. */
    ISP_SPECKCWB_S                       stWBNeutral;                /* RW;WB gain returned when AWB calculation can not be performed. */
    GK_U8                                bLastIsFlash;               /* RW;Range:[1]: The last table is used for flash. 0: Used for unknown Bv value. */
    GK_S16                               s16BvFlashELimit;           /* RW;Range:[-32768, 32767];Threshold of Bv value before strobe lighting when using table for strobe. If bLastIsFlash == TRUE and the Bv value before strobe flash is less than this value, use the table for strobe. */
    GK_S32                               s32APercent;                /* RW;Range:[0, 100];A value percent of the WB statics */
    ISP_SPECKCWBS16_S                    stWBCnvTbl[SPECAWB_FACTTBL_SIZE][SPECAWB_FACTTBL_SIZE];     /* RW; WB gain conversion table (incomplete chromatic adaptation table). */
    GK_U8                                u8ElementNum;                                               /* RW; Range:[7];Number of connected ISP_SPECAWB_FACTTBL_ELEMENT. */
    ISP_SPECAWB_FACTTBL_ELEMENT_S        stFactElement[SPECAWB_FACTTBL_ELMNUM];                      /* RW; Weight Table */
    ISP_SPECAWB_KELVIN_DBB_MAP_S         stKelvinDBBTbl[SPECAWB_FACTTBL_SIZE][SPECAWB_FACTTBL_SIZE]; /* RW;KelvinDbb table. */
    ISP_SPECAWB_BBL_TBL_S                stBlackBodyTbl[SPECAWB_BBL_SIZE];                           /* RW;BlackBody table. */
    GK_U16                               u16Fno;                                                     /* RW; Range:[10, 100];F number of the len,F1.4=14,F2.8=28,F36 =360... */
} ISP_SPECAWB_ATTR_S;

typedef struct ISP_SPECAWB_CONTROL_ATTR_S {
    GK_S16 s16BlendHighBvThresh;          /* RW; Range: [-32768, 32767]; High Bv threshold for inner blending function */
    GK_U16 u16BlendHighBvWt;              /* RW; Range: [0, 2048]; High Bv  weight for inner blending function */
    GK_S16 s16BlendLowBvThresh;           /* RW; Range: [-32768, s16BlendHighBvThresh); Low Bv threshold for inner blending function */
    GK_U16 u16BlendLowBvWt;               /* RW; Range: [0, 2048]; Low Bv  weight for inner blending function */
} ISP_SPECAWB_CONTROL_ATTR_S;

#define SPECAWB_MAX_CAA_NUM                       3
#define SPECAWB_KEVIN_CONVER_MAX_NUM              8

typedef struct ISP_SPECAWB_CAA_CONVERSION_S {
    GK_S32 s32SrcKelvin;    /* RW;Range:[-2147483648, 2147483647]; Source kelvin */
    GK_S32 s32DstKelvin;    /* RW;Range:[-2147483648, 2147483647]; Destination kelvin */
} ISP_SPECAWB_CAA_CONVERSION_S;
typedef struct ISP_SPECAWB_CAA_TBL_S {
    GK_U8   u8Enable;       /* RW;Range:[0,1]; lut enable */
    GK_S16  s16Bv;          /* RW;Range:[-32768, 32767]; Bv value */
    ISP_SPECAWB_CAA_CONVERSION_S stKelvinCon[SPECAWB_KEVIN_CONVER_MAX_NUM];
    ISP_SPECKCWBS16_S stWBCnvTbl[SPECAWB_FACTTBL_SIZE][SPECAWB_FACTTBL_SIZE];
} ISP_SPECAWB_CAA_TBL_S;

typedef struct ISP_SPECAWB_CAA_CONTROl_S {
    ISP_SPECAWB_CAA_TBL_S stControl[SPECAWB_MAX_CAA_NUM];
} ISP_SPECAWB_CAA_CONTROl_S;
typedef struct ISP_MWB_ATTR_S {
    GK_U16 u16Rgain;            /* RW; Range: [0x0, 0xFFF]; Format:4.8; Multiplier for R  color channel  */
    GK_U16 u16Grgain;           /* RW; Range: [0x0, 0xFFF]; Format:4.8; Multiplier for Gr color channel */
    GK_U16 u16Gbgain;           /* RW; Range: [0x0, 0xFFF]; Format:4.8; Multiplier for Gb color channel */
    GK_U16 u16Bgain;            /* RW; Range: [0x0, 0xFFF]; Format:4.8; Multiplier for B  color channel */
} ISP_MWB_ATTR_S;

typedef enum ISP_AWB_ALG_E {
    ALG_AWB         = 0,
    ALG_AWB_SPEC    = 1,
    ALG_BUTT
} ISP_AWB_ALG_E;
typedef struct ISP_WB_ATTR_S {
    GK_BOOL bByPass;              /* RW; Range: [0, 1];  Format:1.0; If enabled, awb will be bypassed */
    GK_U8   u8AWBRunInterval;         /* RW; Range: [0x1, 0xFF];  Format:8.0; set the AWB run interval */
    ISP_OP_TYPE_E   enOpType;
    ISP_MWB_ATTR_S  stManual;
    ISP_AWB_ATTR_S  stAuto;
    ISP_AWB_ALG_E enAlgType;
} ISP_WB_ATTR_S;

typedef struct ISP_COLORMATRIX_MANUAL_S {
    GK_BOOL bSatEn;                           /* RW; Range: [0, 1]; Format:1.0; If bSatEn=1, the active CCM = SatMatrix * ManualMatrix, else tha active CCM =  ManualMatrix */
    GK_U16 au16CCM[CCM_MATRIX_SIZE];          /* RW; Range: [0x0, 0xFFFF]; Format:8.8; Manul CCM matrix, */
} ISP_COLORMATRIX_MANUAL_S;

typedef struct ISP_COLORMATRIX_PARAM_S {
    GK_U16 u16ColorTemp;                   /* RW; Range: [500, 30000]; Format:16.0; the current color temperature */
    GK_U16 au16CCM[CCM_MATRIX_SIZE];       /* RW; Range: [0x0, 0xFFFF]; Format:8.8; CCM matrixes for different color temperature */
} ISP_COLORMATRIX_PARAM_S;

typedef struct ISP_COLORMATRIX_AUTO_S {
    GK_BOOL bISOActEn;                     /* RW; Range: [0, 1]; Format:1.0; if enabled, CCM will bypass in low light */
    GK_BOOL bTempActEn;                    /* RW; Range: [0, 1]; Format:1.0; if enabled, CCM will bypass when color temperature is larger than 8000K or less than 2500K */
    GK_U16  u16CCMTabNum;                  /* RW; Range: [0x3, 0x7]; Format:16.0; The number of CCM matrixes */
    ISP_COLORMATRIX_PARAM_S astCCMTab[CCM_MATRIX_NUM];
} ISP_COLORMATRIX_AUTO_S;

typedef struct ISP_COLORMATRIX_ATTR_S {
    ISP_OP_TYPE_E enOpType;
    ISP_COLORMATRIX_MANUAL_S stManual;
    ISP_COLORMATRIX_AUTO_S stAuto;
} ISP_COLORMATRIX_ATTR_S;

typedef struct ISP_SATURATION_MANUAL_S {
    GK_U8   u8Saturation;        /* RW; Range: [0, 0xFF]; Format:8.0; set the manual saturation of CCM */
} ISP_SATURATION_MANUAL_S;

typedef struct ISP_SATURATION_AUTO_S {
    GK_U8   au8Sat[ISP_AUTO_ISO_STRENGTH_NUM];           /* RW; Range: [0, 0xFF]; should be decreased with increasing ISO */
} ISP_SATURATION_AUTO_S;

typedef struct ISP_SATURATION_ATTR_S {
    ISP_OP_TYPE_E enOpType;
    ISP_SATURATION_MANUAL_S stManual;
    ISP_SATURATION_AUTO_S stAuto;
} ISP_SATURATION_ATTR_S;

typedef struct ISP_COLOR_TONE_ATTR_S {
    GK_U16 u16RedCastGain;        /* RW; Range: [0x100, 0x180]; Format:4.8; R channel gain after CCM */
    GK_U16 u16GreenCastGain;      /* RW; Range: [0x100, 0x180]; Format:4.8; G channel gain after CCM */
    GK_U16 u16BlueCastGain;       /* RW; Range: [0x100, 0x180]; Format:4.8; B channel gain after CCM */
} ISP_COLOR_TONE_ATTR_S;

typedef struct ISP_WB_INFO_S {
    GK_U16 u16Rgain;                /* R; Range: [0x0, 0xFFF]; Format:8.8;AWB result of R color channel */
    GK_U16 u16Grgain;               /* R; Range: [0x0, 0xFFF]; Format:8.8; AWB result of Gr color channel */
    GK_U16 u16Gbgain;               /* R; Range: [0x0, 0xFFF]; Format:8.8; AWB result of Gb color channel */
    GK_U16 u16Bgain;                /* R; Range: [0x0, 0xFFF]; Format:8.8; AWB result of B color channel */
    GK_U16 u16Saturation;           /* R; Range: [0x0, 0xFF];Format:8.0;Current saturation */
    GK_U16 u16ColorTemp;            /* R; Range: [0x0, 0xFFFF];Format:16.0;Detect color temperature, maybe out of color cemeprature range */
    GK_U16 au16CCM[CCM_MATRIX_SIZE];              /* R; Range: [0x0, 0xFFFF];Format:16.0;Current color correction matrix */

    GK_U16 u16LS0CT;                                 /* R; Range: [0x0, 0xFFFF];Format:16.0;color tempearture of primary light source */
    GK_U16 u16LS1CT;                                 /* R; Range: [0x0, 0xFFFF];Format:16.0;color tempearture of secondary light source */
    GK_U16 u16LS0Area;                               /* R; Range: [0x0, 0xFF];Format:8.0;area of primary light source */
    GK_U16 u16LS1Area;                               /* R; Range: [0x0, 0xFF];Format:8.0;area of secondary light source */
    GK_U8  u8MultiDegree;                            /* R; Range: [0x0, 0xFF];0 means uniform light source, larger value means multi light source */
    GK_U16 u16ActiveShift;                           /* R; Range;[0x0,0xFF] */
    GK_U32 u32FirstStableTime;                       /* R, Range: [0x0, 0xFFFFFFFF];Format:32.0;AWB first stable frame number */
    ISP_AWB_INDOOR_OUTDOOR_STATUS_E enInOutStatus;   /* R; indoor or outdoor status */
    GK_S16  s16Bv;                                   /* R; Range;[-32768, 32767]; Bv value */
} ISP_WB_INFO_S;



/********************* AF structs ************************/

typedef struct ISP_AF_ATTR_S {
    GK_S32 s32DistanceMax; /* RW;the focuse range */
    GK_S32 s32DistanceMin;
    GK_U8 u8Weight[AF_ZONE_ROW][AF_ZONE_COLUMN]; /* RW;weighting table */
} ISP_AF_ATTR_S;
typedef struct ISP_MF_ATTR_S {
    GK_S32 s32DefaultSpeed;     /* RW;1,default speed(unit:m/s).(onvif) */
} ISP_MF_ATTR_S;
typedef struct ISP_FOCUS_ATTR_S {
    ISP_OP_TYPE_E  enOpType;
    ISP_MF_ATTR_S  stManual;
    ISP_AF_ATTR_S  stAuto;
} ISP_FOCUS_ATTR_S;

/*
DNG cfalayout type
1 = Rectangular (or square) layout
2 = Staggered layout A: even columns are offset down by 1/2 row
3 = Staggered layout B: even columns are offset up by 1/2 row
4 = Staggered layout C: even rows are offset right by 1/2 column
5 = Staggered layout D: even rows are offset left by 1/2 column
6 = Staggered layout E: even rows are offset up by 1/2 row, even columns are offset left by 1/2 column
7 = Staggered layout F: even rows are offset up by 1/2 row, even columns are offset right by 1/2 column
8 = Staggered layout G: even rows are offset down by 1/2 row, even columns are offset left by 1/2 column
9 = Staggered layout H: even rows are offset down by 1/2 row, even columns are offset right by 1/2 column
*/
typedef enum DNG_CFALAYOUT_TYPE_E {
    CFALAYOUT_TYPE_RECTANGULAR = 1,
    CFALAYOUT_TYPE_A,        /* a,b,c... not support */
    CFALAYOUT_TYPE_B,
    CFALAYOUT_TYPE_C,
    CFALAYOUT_TYPE_D,
    CFALAYOUT_TYPE_E,
    CFALAYOUT_TYPE_F,
    CFALAYOUT_TYPE_G,
    CFALAYOUT_TYPE_H,
    CFALAYOUT_TYPE_BUTT
} DNG_CFALAYOUT_TYPE_E;

typedef struct DNG_SRATIONAL_S {
    GK_S32 s32Numerator;   /* represents the numerator of a fraction, */
    GK_S32 s32Denominator; /* the denominator. */
} DNG_SRATIONAL_S;

typedef struct DNG_BLCREPEATDIM_S {
    GK_U16 u16BlcRepeatRows;
    GK_U16 u16BlcRepeatCols;
} DNG_BLCREPEATDIM_S;

typedef struct DNG_DEFAULTSCALE_S {
    DNG_RATIONAL_S stDefaultScaleH;
    DNG_RATIONAL_S stDefaultScaleV;
} DNG_DEFAULTSCALE_S;

typedef struct DNG_REPEATPATTERNDIM_S {
    GK_U16 u16RepeatPatternDimRows;
    GK_U16 u16RepeatPatternDimCols;
} DNG_REPEATPATTERNDIM_S;

/*
Defines the structure of dng raw format.
*/
typedef struct DNG_RAW_FORMAT_S {
    GK_U8 u8BitsPerSample;                        /* RO;Format:8.0; Indicate the bit numbers of raw data */
    GK_U8 au8CfaPlaneColor[CFACOLORPLANE];        /* RO;Format:8.0; Indicate the planer numbers of raw data; 0:red 1:green 2: blue */
    DNG_CFALAYOUT_TYPE_E enCfaLayout;             /* RO;Range:[1,9]; Describes the spatial layout of the CFA */
    DNG_BLCREPEATDIM_S stBlcRepeatDim;            /* Specifies repeat pattern size for the BlackLevel */
    GK_U32 u32WhiteLevel;                         /* RO;Format:32.0; Indicate the WhiteLevel of the raw data */
    DNG_DEFAULTSCALE_S stDefaultScale;            /* Specifies the default scale factors for each direction to convert the image to square pixels */
    DNG_REPEATPATTERNDIM_S stCfaRepeatPatternDim; /* Specifies the pixel number of repeat color planer in each direction */
    GK_U8 au8CfaPattern[ISP_BAYER_CHN];           /* RO;Format:8.0; Indicate the bayer start order; 0:red 1:green 2: blue */
} DNG_RAW_FORMAT_S;

/*
Defines the structure of dng image static infomation. read only
*/
typedef struct DNG_IMAGE_STATIC_INFO_S {
    DNG_RAW_FORMAT_S stDngRawFormat;
    DNG_SRATIONAL_S astColorMatrix1[CCM_MATRIX_SIZE];       /* defines a transformation matrix that converts XYZ values to reference camera native color space values, under the first calibration illuminant. */
    DNG_SRATIONAL_S astColorMatrix2[CCM_MATRIX_SIZE];       /* defines a transformation matrix that converts XYZ values to reference camera native color space values, under the second calibration illuminant. */
    DNG_SRATIONAL_S astCameraCalibration1[CCM_MATRIX_SIZE]; /* defines a calibration matrix that transforms reference camera native space values to individual camera native space values under the first calibration illuminant */
    DNG_SRATIONAL_S astCameraCalibration2[CCM_MATRIX_SIZE]; /* defines a calibration matrix that transforms reference camera native space values to individual camera native space values under the second calibration illuminant */
    DNG_SRATIONAL_S astForwadMatrix1[CCM_MATRIX_SIZE];      /* defines a matrix that maps white balanced camera colors to XYZ D50 colors */
    DNG_SRATIONAL_S astForwadMatrix2[CCM_MATRIX_SIZE];      /* defines a matrix that maps white balanced camera colors to XYZ D50 colors */

    GK_U8  u8CalibrationIlluminant1;                       /* RO;Format:8.0;Light source, actually this means white balance setting. '0' means unknown, '1' daylight, '2'
                                                                 fluorescent, '3' tungsten, '10' flash, '17' standard light A, '18' standard light B, '19' standard light
                                                                 C, '20' D55, '21' D65, '22' D75, '255' other */
    GK_U8  u8CalibrationIlluminant2;                       /* RO;Format:8.0;Light source, actually this means white balance setting. '0' means unknown, '1' daylight, '2'
                                                                 fluorescent, '3' tungsten, '10' flash, '17' standard light A, '18' standard light B, '19' standard light
                                                                 C, '20' D55, '21' D65, '22' D75, '255' other */
} DNG_IMAGE_STATIC_INFO_S;

/*
Defines the structure of DNG WB gain used for calculate DNG colormatrix.
*/
typedef struct ISP_DNG_WBGAIN_S {
    GK_U16 u16Rgain;            /* RW;Range: [0x0, 0xFFF]; Multiplier for R  color channel */
    GK_U16 u16Ggain;            /* RW;Range: [0x0, 0xFFF]; Multiplier for G  color channel */
    GK_U16 u16Bgain;            /* RW;Range: [0x0, 0xFFF]; Multiplier for B  color channel */
} ISP_DNG_WBGAIN_S;

/*
Defines the structure of DNG color parameters.
*/
typedef struct ISP_DNG_COLORPARAM_S {
    ISP_DNG_WBGAIN_S stWbGain1; /* the calibration White balance gain of colorcheker in low colortemper light source */
    ISP_DNG_WBGAIN_S stWbGain2; /* the calibration White balance gain of colorcheker in high colortemper light source */
} ISP_DNG_COLORPARAM_S;


typedef enum ISP_IR_STATUS_E {
    ISP_IR_STATUS_NORMAL = 0,
    ISP_IR_STATUS_IR     = 1,
    ISP_IR_BUTT
} ISP_IR_STATUS_E;

typedef enum ISP_IR_SWITCH_STATUS_E {
    ISP_IR_SWITCH_NONE      = 0,
    ISP_IR_SWITCH_TO_NORMAL = 1,
    ISP_IR_SWITCH_TO_IR     = 2,
    ISP_IR_SWITCH_BUTT
} ISP_IR_SWITCH_STATUS_E;


typedef struct ISP_IR_AUTO_ATTR_S {
    GK_BOOL bEnable;            /* RW, GK_TRUE: enable IR_auto function;  GK_TRUE: disable IR_auto function. */
    GK_U32  u32Normal2IrIsoThr; /* RW, Range: [0, 0xFFFFFFFF]. ISO threshold of switching from normal to IR mode. */
    GK_U32  u32Ir2NormalIsoThr; /* RW, Range: [0, 0xFFFFFFFF]. ISO threshold of switching from IR to normal mode. */
    GK_U32  u32RGMax;           /* RW, Range: [0x0, 0xFFF].    Maximum value of R/G in IR scene, 4.8-bit fix-point. */
    GK_U32  u32RGMin;           /* RW, Range: [0x0, u32RGMax]. Minimum value of R/G in IR scene, 4.8-bit fix-point. */
    GK_U32  u32BGMax;           /* RW, Range: [0x0, 0xFFF].    Maximum value of B/G in IR scene, 4.8-bit fix-point. */
    GK_U32  u32BGMin;           /* RW, Range: [0x0, u32BGMax]. Minimum value of B/G in IR scene, 4.8-bit fix-point. */

    ISP_IR_STATUS_E enIrStatus; /* RW. Current IR status. */

    ISP_IR_SWITCH_STATUS_E enIrSwitch; /* RO, IR switch status. */
} ISP_IR_AUTO_ATTR_S;

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* End of #ifdef __cplusplus */

#endif /* __ISP_COMM_ISP_H__ */
